Saturday, April 29, 2023

AssemblyScript vs TypeScript


AssemblyScript is *not* a subset of TypeScript - DEV Community"

AssemblyScript definitely not a TypeScript to Web Assembly compiler. In fact, there are lots of differences between the syntaxes used in TypeScript that don't match up nicely with AssemblyScript."


AssemblyScript

Designed for WebAssembly: AssemblyScript targets WebAssembly's feature set specifically, giving developers low-level control over their code.

Familiar TypeScript syntax: Its similarity with TypeScript makes it easy to compile to WebAssembly without learning a new language.

Right at your fingertips: Integrates with the existing Web ecosystem - no heavy toolchains to set up. Simply npm install it!



TypeScript is a strongly typed programming language that builds on JavaScript, giving you better tooling at any scale.

AI Code Generator - Amazon CodeWhisperer @ AWS

AI Code Generator - Amazon CodeWhisperer - AWS

CodeWhisperer is trained on billions of lines of code and can generate code suggestions ranging from snippets to full functions in real time based on your comments and existing code. Bypass time-consuming coding tasks and accelerate building with unfamiliar APIs.


Friday, April 28, 2023

Inside OpenAI with Ilya Sutskever

Inside OpenAI [Entire Talk] - YouTube

Ilya Sutskever is the co-founder and chief scientist of OpenAI, which aims to build artificial general intelligence that benefits all of humanity. He leads research at OpenAI and is one of the architects behind the GPT models. In this conversation with Stanford adjunct lecturer Ravi Belani, Sutskever explains his approach to making complex decisions at OpenAI and for AI companies in general, and makes predictions about the future of deep learning.

JS chess engine + React UI

no dependencies! MIT

josefjadrny/js-chess-engine: Simple JavaScript chess engine without dependencies written in NodeJs. It can be used on both, server or client (web browser) and do not need persistent storage - handy for serverless solutions like AWS Lambda. This engine includes configurable AI computer logic. @ GitHub

Simple JavaScript chess engine without dependencies written in NodeJs. It can be used on both, server or client (web browser) and do not need persistent storage - handy for serverless solutions like AWS Lambda. This engine also includes configurable basic AI computer logic.

examples

js-chess-engine-app - React application example with js-chess-engine REST API backend (without persistent storage) - GitHub or LIVE DEMO

Simple Fastify server
Console
PC vs PC match


josefjadrny/js-chess-engine-app: Single-page React app example for js-chess engine backend @GitHub

single-page React app example for js-chess-engine backend.

Live DEMO


js-chess-engine - npm


some alternatives:

Build a Simple Chess AI in JavaScript - DEV Community

Chess AI (https://zeyu2001.github.io/chess-ai/)

zeyu2001/chess-ai: Simple chess AI in JavaScript. Uses the chess.js and chessboard.js libraries. @GitHub


A step-by-step guide to building a simple chess AI @ freecodecamp

lhartikk/simple-chess-ai: A simple chess AI @GitHub


raydog/deno-chess: A Typescript Chess engine. @GitHub

Deno-Chess is a speedy pure-Typescript chess engine. It is packaged for Deno, as well as for the browser (TypeScript, MIT)



chessboardjs.com » Homepage

jbkunst/chessboardjs-themes: A try to make chessboardjs pieces and color themes

♕ Chessboarjs Pieces Themes

Wednesday, April 26, 2023

containers: Alpine Linux DNS issue

Why I Will Never Use Alpine Linux Ever Again | Martin Heinz | Personal Website & Blog

"To understand what makes Alpine a bad choice in some situations, we first need to talk about musl. musl is an implementation of C standard library. It is more lightweight, faster and simpler than glibc used by other Linux distros, such as Ubuntu. Both of these implementations are interchangeable for the most part, that's why in most cases you can switch from e.g., Ubuntu to Alpine and never notice any difference.

However, the little differences can cause all the grief. Some of it stems from how musl (and therefore also Alpine) handles DNS (it's always DNS), more specifically, musl (by design) doesn't support DNS-over-TCP. Usually, you would not notice this difference, because most of the time a single UDP packet (512 bytes) is enough to resolve hostnames... until it isn't enough and your application (running on Kubernetes) that previously worked completely fine for months suddenly starts throwing "Unknown Host" exceptions for one particular (very critical) hostname. The worst part is that this can manifest randomly, anytime when some external network change causes the resolution of some particular domain to require more than the 512 bytes available in single UDP packet.

By using Alpine, you're getting "free" chaos engineering for you cluster."


workaround: use short names for services in K8s.



Sunday, April 23, 2023

book: Language Implementation Patterns

Language Implementation Patterns: Create Your Own Domain-Specific and General Programming Languages by Terence Parr

Learn to build configuration file readers, data readers, model-driven code generators, source-to-source translators, source analyzers, and interpreters. You don’t need a background in computer science—ANTLR creator Terence Parr demystifies language implementation by breaking it down into the most common design patterns. Pattern by pattern, you’ll learn the key skills you need to implement your own computer languages.


Language Implementation Patterns



Testing ANTLR4

ANTLR.org

ANTLR (ANother Tool for Language Recognition) is a powerful parser generator for reading, processing, executing, or translating structured text or binary files. It's widely used to build languages, tools, and frameworks. From a grammar, ANTLR generates a parser that can build and walk parse trees.

ANTLR Lab: learn, test, and experiment with ANTLR grammars online!

antlr/antlr4-lab: A client/server for trying out and learning about ANTLR


Download ANTLR

The latest version of ANTLR is 4.12.0, released February 19, 2023


download and use Java from Oracle, not from java.com


copy .jar to Java "lib" folder, and
add location of antlr jar file to java CLASSPATH env var

C:\Program Files\Java\jdk-20\lib\antlr-4.12.0-complete.jar;%CLASSPATH%;

antlr4/javascript-target.md at master · antlr/antlr4 · GitHub

for JavaScript examples to work, the version of antrl4 jar file and antlr4.js have to match.

to achieve this one way is to set fixed version of antlr4.js in node.js package.json file


ANTLR examples from Strumenta

The ANTLR Mega Tutorial

gabriele-tomassetti/antlr-mega-tutorial: This is the companion repository of the ANTLR Mega Tutorial, that will explain everything you need to know to use ANTLR.


ANTLR and the web: a simple example - Strumenta

ftomassetti/antlr-web-example


VS Code plugins

ANTLR4 grammar syntax support - Visual Studio Marketplace



Friday, April 21, 2023

AI: Google Bard += software development

Bard.google.com


Google’s Bard AI chatbot can now generate and debug code | TechCrunch

"Google said Friday it is launching these software development capabilities in more than 20 programming languages including C++, Go, Java, JavaScript, Python and TypeScript. Users can export Python code to Google Colab. Bard can also help with writing functions for Google Sheets.

Collectively, this means that Bard, the generative AI experiment Google launched earlier this year, can review and help users debug their source code line by line. Google said developers can tell Bard “this code didn’t work, please fix it,” and it will help debug.

It can also translate code from one language to another and explain code snippets, a helpful feature for those new to programming.

Bard, which was created to compete with ChatGPT and other language models, didn’t quite stack up to its AI peers in TechCrunch’s own testing on chatbot performance. This latest set of skills could help Bard at least keep apace with ChatGPT and Claude — at least on paper."

book: Seven Languages in Seven Weeks

 Seven Languages in Seven Weeks: A Pragmatic Guide to Learning Programming Languages (Pragmatic Programmers): Tate, Bruce: 8601234653110: Amazon.com: Books

Ruby, Io, Prolog, Scala, Erlang, Clojure, Haskell.

With 
Seven Languages in Seven Weeks, by Bruce A. Tate, you'll go beyond the syntax-and beyond the 20-minute tutorial you'll find someplace online. This book has an audacious goal: to present a meaningful exploration of seven languages within a single book. Rather than serve as a complete reference or installation guide, Seven Languages hits what's essential and unique about each language. Moreover, this approach will help teach you how to grok new languages.


Seven Languages in Seven Weeks



Thursday, April 20, 2023

free e-book: Redis for Dummies

Redis for Dummies | Redis

Download the Redis for Dummies e-book now (66 pages)


SpaceX: Starship Flight Test

Starship Flight Test - YouTube

the first flight test of a fully integrated Starship and Super Heavy rocket from Starbase in Texas

 Starship launch latest news: SpaceX prepares for Mars-bound rocket test as date revealed | The Independent

(FAA) has marked 17 April as the primary launch date. There are also backup launch dates in place for 18-22 April, according to the FAA’s Operation Plans Advisory report.

SpaceX postpones Starship orbital launch attempt @CNBC


Wednesday, April 19, 2023

AI: danger and benefit

Stuart Russell - How Not To Destroy the World With AI - YouTube


Exclusive Conversation With Prof Stuart Russell On Whether AI Is A Threat To Humanity - YouTube


Elon Musk tells Tucker potential dangers of hyper-intelligent AI - YouTube


Hello World: Meet Generative AI | Amazon Web Services - YouTube



Ionic 7

  1.  Ionic 7 is here! - Ionic Blog

Changes include:

  • Inline Overlays - Declarative overlays are now available on all overlay components 
  • Consistent Event Emissions - ionChange will only fire as a result of user interaction
  • Simplified Form Control Syntax - Improved compatibility with assistive technologies and less code boilerplate 
  • Performance Improvements - Tab switches are up to 70% faster than they were in v6
  • And so much more...

How ChatGPT works, by Cal Newport, MIT PhD

Ep. 244: Cal Newport’s Thoughts on ChatGPT - YouTube

Are new AI technologies like ChatGPT about to massively disrupt our world? Drawing from his recent New Yorker article on the topic, Cal explains exactly how programs like ChatGPT work, and uses this knowledge to explain why we can calm our fears about this new technology. 
Links from today's episode: 

Tuesday, April 18, 2023

Auto-GPT: self-improving AI

 Significant-Gravitas/Auto-GPT: An experimental open-source attempt to make GPT-4 fully autonomous. @GitHub


Auto-GPT is an experimental open-source application showcasing the capabilities of the GPT-4 language model. This program, driven by GPT-4, chains together LLM "thoughts", to autonomously achieve whatever goal you set. As one of the first examples of GPT-4 running fully autonomously, Auto-GPT pushes the boundaries of what is possible with AI.

ChatGPT Prompts Itself - Should We Fear AutoGPT? - YouTube

book: The Singularity Is Nearer by Ray Kurzweil (coming in 2024)

What The 2030s Will Look Like with Ray Kurzweil - YouTube

What is the singularity? On this explainer, Neil deGrasse Tyson gets some help from futurist, author, and inventor, Ray Kurzweil, to explain our eventual merge with computers. Could a machine pass a Turing test as soon as 2029?

The Singularity Is Nearer , Kurzweil, Ray - Amazon.com


The Singularity Is Near: When Humans Transcend Biology, Kurzweil, Ray, eBook - Amazon.com

The Singularity Is Near - Wikipedia

Ray Kurzweil - Wikipedia


Monday, April 17, 2023

personal media server sw

 Jellyfin - Wikipedia

Jellyfin is a free and open-source media server and suite of multimedia applications designed to organize, manage, and share digital media files to networked devices. Jellyfin consists of a server application installed on a machine running Microsoft WindowsmacOSLinux or in a Docker container, and another application running on a client device such as a smartphonetabletsmart TVstreaming media playergame console or in a web browser.[2] Jellyfin also can serve media to DLNA and Chromecast-enabled devices.[3] It is a fork of Emby.[4]

Nextcloud - Online collaboration platform


Mac mini (October 2014) Core i5 1.4 GHz - HDD 500 GB - 8GB | Back Market

$130 (used, 1 year warranty)


Amazon.com: Beelink Mini PC - 4 Cores i5-8279U (Up to 4.1GHz) SEi8 Mini Desktop Computer - 16GB DDR4 500GB SSD Small PC, WiFi 5, 4K Dual HDMI, BT5.0, Gigabit Ethernet : Video Games

$270, new


symbolic math computation: math.js vs SymPy

math.js | an extensive math library for JavaScript and Node.js

Math.js is an extensive math library for JavaScript and Node.js. It features a flexible expression parser with support for symbolic computation, comes with a large set of built-in functions and constants, and offers an integrated solution to work with different data types like numbers, big numbers, complex numbers, fractions, units, and matrices. Powerful and easy to use.

SymPy translation to JavaScript · Issue #165 · open-source-ideas/ideas


SymPy

SymPy is a Python library for symbolic mathematics. It aims to become a full-featured computer algebra system (CAS) while keeping the code as simple as possible in order to be comprehensible and easily extensible. SymPy is written entirely in Python.


Sunday, April 16, 2023

Microsoft Edge WebView2 vs Electron

Introduction to Microsoft Edge WebView2 - Microsoft Edge Development | Microsoft Learn

used by new version of MS Teams, claims to be 2x faster, whatever this means...

it is also well integrated with dotnet, in addition C++/node.js, 

"should" be able to also support non-Windows platforms, to be investigated...

WebView2 - Microsoft Edge Developer

ChatGPT doesn't keep secrets

Samsung ChatGPT leak: Samsung workers accidentally leak trade secrets to the AI chatbot | Mashable

Never forget that anything you share with ChatGPT is retained and used to further train the model. Samsung employees have learned this the hard way after accidentally leaking top secret Samsung data.

AI danger! a warning from MIT

excellent podcast interview

also an interesting view on "machine intelligence"
at this point is is focused on performing tasks, with no "consciousness"
and interestingly, humans also have "sub consciousness mind", focused on tasks.
the difference is that human sub-conscious does not have language capability, 
while latest AI (LLMs, like ChatGPT) do...
and they also has APIs to integrate with "agents" to perform actions.
No consciousness, with capability to do almost anything, and no oversight: big danger!

we are now dealing with "cute baby AI", soon to become AGI monster?

Max Tegmark: The Case for Halting AI Development | Lex Fridman Podcast #371 - YouTube

Max Tegmark is a physicist and AI researcher at MIT, co-founder of the Future of Life Institute, and author of Life 3.0: Being Human in the Age of Artificial Intelligence.

Max's Twitter: https://twitter.com/tegmark 
Pause Giant AI Experiments (open letter): https://futureoflife.org/open-letter/... 
Future of Life Institute: https://futureoflife.org 
Books and resources mentioned: 
1. Life 3.0 (book): https://amzn.to/3UB9rXB 
2. Meditations on Moloch (essay): https://slatestarcodex.com/2014/07/30... 








demo :)

Thursday, April 13, 2023

ChatGPT vs ...

Getting the Right Answer from ChatGPT – O’Reilly


What Are ChatGPT and Its Friends? – O’Reilly

GPT-3.5 is one of a class of language models that are sometimes called “large language models” (LLMs)

  • ChatGPT itself
    Developed by OpenAI; based on GPT-3.5 with specialized training. An API for ChatGPT is available.
  • GPT-2, 3, 3.5, and 4
    Large language models developed by OpenAI. GPT-2 is open source. GPT-3 and GPT-4 are not open source, but are available for free and paid access. The user interface for GPT-4 is similar to ChatGPT.
  • Sydney
    The internal code name of the chatbot behind Microsoft’s improved search engine, Bing. Sydney is based on GPT-4,1 with additional training.
  • Kosmos-1
    Developed by Microsoft, and trained on image content in addition to text. Microsoft plans to release this model to developers, though they haven’t yet.
  • LaMDA
    Developed by Google; few people have access to it, though its capabilities appear to be very similar to ChatGPT. Notorious for having led one Google employee to believe that it was sentient.
  • PaLM
    Also developed by Google. With three times as many parameters as LaMDA, it appears to be very powerful. PaLM-E, a variant, is a multimodal model that can work with images; it has been used to control robots. Google has announced an API for PaLM, but at this point, there is only a waiting list.
  • Chinchilla
    Also developed by Google. While it is still very large, it is significantly smaller than models like GPT-3 while offering similar performance.
  • Bard
    Google’s code name for its chat-oriented search engine, based on their LaMDA model, and only demoed once in public. A waiting list to try Bard was recently opened.
  • Claude
    Developed by Anthropic, a Google-funded startup. Poe is a chat app based on Claude, and available through Quora; there is a waiting list for access to the Claude API.
  • LLaMA
    Developed by Facebook/Meta, and available to researchers by application. Facebook released a previous model, OPT-175B, to the open source community. The LLaMA source code has been ported to C++, and a small version of the model itself (7B) has been leaked to the public, yielding a model that can run on laptops.
  • BLOOM
    An open source model developed by the BigScience workshop.
  • Stable Diffusion
    An open source model developed by Stability AI for generating images from text. A large language model “understands” the prompt and controls a diffusion model that generates the image. Although Stable Diffusion generates images rather than text, it’s what alerted the public to the ability of AI to process human language.

online IDE tool: StackBlitz

VS Code in web browser, including server side!

stackblitz.com/

StackBlitz, an online development environment for frontend, Node.js and the JavaScript ecosystem.




Wednesday, April 12, 2023

Microsoft Teams "2.0" with React, WebView2: 2x faster

Introducing the new Microsoft Teams | Microsoft 365 Blog

Microsoft rebuilt Teams from the ground up, promises 2x faster performance | TechCrunch

it optimized the Teams data, network, chat and video architecture to achieve this. A significant part of this enhancement also results from the app’s transition from Electron to Microsoft’s Edge WebView 2 rendering engine. Microsoft also notes that it moved from using AngularJS as the web development framework for Teams to React for building the user interface and standardized on Microsoft’s Fluent UI UX controls.


Create a unique ID with javascript time

Create a unique number with javascript time - Stack Overflow

Date.now().toString(36)

'lge1j7wp'

How to generate a Unique ID in JavaScript - Clue Mediator


1
2
3
4
5
6
const uid = function(){
  return Date.now().toString(36) + Math.random().toString(36).substr(2);
}
 
console.log(uid());
// Output: kyg0z26npc43wq7vaa