Xah Programing Blog

Syntactic obsession, imperative despisal, unicode love ♥, hacker hate.

Blog Archive

  • thumbnail
    Windows Open File Dialog Slash Problem
  • for programers. here are few critical article for programing language syntax designers. and if you are a lisp fan or WolframLang fan. you get an in-depth understanding of syntax issues.


    repost

    AI is Unstoppable, Tech is Unstoppable

    ai is not stoppable 2023-05-26
    ai is not stoppable 2023-05-26

    lol. but the thing with tech is, it's not pausable. If you pause, for ethic or other reasons, others will do it. Then, u will follow or perish. That's what technology is. (AI, robotics, genetics, bio, nano, gigagun, clones, chimera, borg, all's coming.)

    on GPU vs CPU algorithms compilation, C++, parallel computation, Wolfram Physics

    GPU vs CPU algo compilation 2023-05-22
    2023-05-22 on GPU vs CPU algorithms compilation, C++, parallel computation, Wolfram Physics
    sentient ai 2023-05-18 210840
    sentient ai 2023-05-18 210840

    ChatGPT, Turing Test, Sentient AI?

    The chatGPT opened a chapter in AI, but we learned that, a machine that can write human quality poem, is not intelligent, nor is passing turing test.

    After a while, you learned that chatgpt is dumb as hell. It just synthesize web text, and fails everytime when asked a math question. It has no understanding at all.

    This really presses the question, that if AGI, will develop a mind of its own, at all.

    It seems to me, we are even more remote from developing a Sentient AI. But also, we realized, AI needs not to reach sentient to be destructive.

    damn stupid twitter card.

    twitter under jack dorsey, created twitter card, so that your site will have a preview image and title and short summary etc when link is posted to twitter. by adding a bunch of meta tags.

    but the tech exist, from the facebook zukerbug skum, and is call “open graph”. of course, jack dorsey refuse to use it so he create something special just for twitter, and is called “twitter card”.

    and but, twitter card spec is idiotic. it requires a title tag, and a “type” tag (type being “summary” which contains a image thumbnail, or large image, or app, or for video)

    Generative Art, Raytracing, Myers-Briggs, Personality Test, Psychology, Lex Fridman Xah Talk Show 2022-11-24 Generative Art, Raytracing, Myers-Briggs, Personality Test, Psychology, Lex Fridman

    get sha256 hash of a file

    Get-FileHash -Algorithm SHA256 filename

    # get sha256 hash of a file
    Get-FileHash filename
    
    PowerShell get file hash sha256 2023-05-02
    PowerShell get file hash sha256 2023-05-02
    xtodo

    misc updates

    updated.

    Programing Exercise: Show Difference of Sorting Unicode Characters by Code Point vs Code Unit

    /* unicode exercise.
    2023-04-04
    come up with example to demonstrate sorting by code unit and code point
    */
    
    const xx = ["fi","😆"];
    console.log( xx.sort() )
    // [ "😆", "fi" ]
    
    const yy = ["﷽","😆"];
    console.log( yy.sort() )
    // [ "😆", "﷽" ]
    
    /*
    
    😆 codepoint 128518
    name: SMILING FACE WITH OPEN MOUTH AND TIGHTLY-CLOSED EYES
    
    fi codepoint 64257
    name: LATIN SMALL LIGATURE FI
    
    ﷽
    codepoint 65021
    name: ARABIC LIGATURE BISMILLAH AR-RAHMAN AR-RAHEEM
    
    */
    

    JavaScript. the other example to demonstrate sorting by code unit and code point, is bismilla ﷽ . Unicode Arabic ش Unicode Arabic ش

    js sort bismilla 2023-04-03 163406
    js sort bismilla 2023-04-03 163406

    Microsoft Windows snip and sketch problems and shareX

    on Microsoft Windows, the screenshot software snip n sketch sucks. it has multiple problems. 10% of time you got error saying app cannot open. does not auto-save. and when you manually save, it takes a whopping second to popup a save dialog. and then with offensive “please wait while we let ink dry”.

    shareX been using for 2 years, but also have sundry problems. major problem is that it has a delay when you start to drag a region with touchscreen or drawing tablet. this means, you cannot select a precise region. (workaround is to double click on the starting point then drag) but it's builtin drawing tool also does not support stylus or touchscreen well. also a delay problem, so you cannot use it to write anything. (it's also using jagged bitmap lines.) its user interface is extremely complex and sucks donkey ass, with tiny font you cannot read.

    currently trying flameshot. ok, flameshot also got the delay problem. in flameshot, no delay when starting to select a region. great. but when u start to write notes, there's a 0.3 sec delay. e.g. try to write the word “with” in cursive, the dot and horizontal line for letter t won't appear, unless you wait for a fraction of sec before each stroke. much better than sharex and simpler, but still sucks.

    one major problem i found with the elaborate setup i eventually did with sharex and have it launch paint.net is that, after u write something in paint.net, it won't copy result into clipboard. u have to do select all and copy, if u want the screenshot with notes u've written on it, to paste somewhere. this select all and copy, is a major problem when u on a tablet sans keyboard

    gosh. some a simple need, no satisfactory solution.

    here's a summary. all i want, is do a screenshot, select region of interest, and write some notes on it with touchscreen or drawing tablet, and have the final result auto saved and auto copied to clipboard. all this done on a tablet (Microsoft surface pro 4), sans a keyboard.

    actually, Microsoft snip and sketch is the solution. except Microsoft is pretty lousy, that the app fails to start 1 in 20 times or so. and once a month, it completely fail to start, unless u restart windows. but so far, all other complex solutions, seems require more work.

    ai bot chats a hogwash.

    google bard ai chat xah lee 2023-04-02
    google bard ai chat xah lee 2023-04-02

    xtodo review/repost

    xtodo

    Steve Yegge has a new blog

    xtodo
    xtodo

    minor updates and new

    xtodo

    some old articles.

    What is functional programing

    Let me give u a quick guide about functional programing. There's an academic definition. Basically, ur code mostly are just function calls. Function here means like mathematical function. The important thing is, no side effects, means, the function's behavior purely depends on its arguments. Same args, same output, always. And this practically means, don't use global vars, etc in ur subroutine. That's the academic def of fp. Which then can get more complex. This is when, u hear currying, first class citizen, monad, referential transparency, and faaks like that.

    the above is academic view of functional programing. which often is a math based view.

    now, let me give practical view, which is more or less how i began it. the practical view, is that, when you write a subroutine, any lang, you notice, usually it's better if you no use global vars inside it. because that makes your subroutine behavior less predicable, more bug prone, etc.

    i notice, it's nice, if you always write your subroutine such that the behavior just depends on the parameters. aka known as no-side effects, or, pure function.

    this also makes your subroutine independent, you can move it from code to code. and, once you write subroutines that way, it becomes widely usable across, aka code-reuse.

    once you started to write your code this way, in any lang, after a few years, gradually, you'll notice other things you tend to do. e.g. you want the lang to be able to take a subroutine as arg, or output a subroutine. (this is known as function being 'first class' object, academic speak a la scheme lisp)

    also now, if most or all your subroutines are side-effect free, that's called referential transparency, academic speak. meaning, you can just move any function to any other place.

    once you are used to moving function around, you notice, why not other things, such as if statements. i.e. you want if statement to be expression, e.g. like c's (test ? doTrue : doFalse) so that you can move if expression just like you mave functions about.

    and then, why not make for-loop as expression, or any other. basically, you started to want all statement being expressions. this is why, in many functional programing languages, everything are expressions.

    The AI Threat, Year 2023

    the ai threat 2023-03-16 SxMqX
    the ai threat 2023-03-16 SxMqX

    File path functions in various langs. You can compare their design.

    Short History of Ocaml

    xtodo rss

    major updates.

    Windows terminal wt not found

    updated.

    reposts and minor updates

    updates and repost

    misc updates.

    added new images

    misc minor updates

    updated.

    updated.

    misc updates

    how much you make on YouTube

    xahlee youtube money 2023-01-05 2D8Bm
    xahlee youtube money 2023-01-05 2D8Bm

    updated or new

    xtodo
    xtodo

    more js updates. worked in past week.

    massive update on my JavaScript tutorial in past week

    JavaScript Regex Functions, major rewrite. they are very confusing, badly designed.

    some new custom functions

    one example of the worst JavaScript function design. Cannot say which is worse, JavaScript or Python. JavaScript: String.prototype.match (tech writing aspect: page rewritten with clarity. compare it to mozilla mdn (i have not looked))

    updates

    lots JavaScript in depth updates.

    xtodo
    xtodo
    xtodo review

    biggest xmas gift.

    xah thanks andrew 2022-12-27 RNr9r
    xah thanks andrew 2022-12-27 RNr9r

    xtodo review

    xtodo draft

    Principle of regularity, in programing language design

    i really want to love JavaScript, because its functional programing features. but, JavaScript is truly worst lang, too many big warts. it's inferior to python and ruby.

    the worst part that makes js unworkable, is lacking comparison of object/array, and array isn't really array. and no builtin lib, even with js 2022. its lib system is complex shit, even with deno.

    ruby is a far superior lang than python and JavaScript. also far better than emacs lisp, Common Lisp, and perl. and in particular with respect to functional programing, but also for object oriented programing

    ruby is one of those lang, that is systematic. like WolframLang. you learn a handful of principles, and you understand the entire language. golang is similar.

    this, i would call, the PRINCIPLE OF REGULARITY, in programing language design. it has 2 parts. regularity of syntax, and regularity of semantics.


    What constitutes a functional programing language?

    first and most fundamental, is that the lang must support:

    xtodo

    What Object-Oriented Programming Was Supposed to Be: Two Grumpy Old Guys' Take on Object-Oriented Programming

    cites my website

    What oop Ole Birger 2022 mgmjX
    [What Object-Oriented Programming Was Supposed to Be: Two Grumpy Old Guys' Take on Object-Oriented Programming By Ole Lehrmann Madsen, Birger Møller-Pedersen. At https://dl.acm.org/doi/abs/10.1145/3563835.3568735 ]

    updates

    xtodo

    when you do git commit -m"multi message" the git may merge your lines into a singe line. this happens if you are using the bash shell.

    works in PowerShell (xtodo test)

    updates and new

    xtodo
    xtodo

    lots git tutorial update.

    xtodo

    more unicode updates.

    new panel and updates

    go thru ur browser settings, turn off auto anything. no autofill no autopswd no sync nothing. and no themes whatsoever. turn off spellchecking too. off any auto suggestion. off with their heads.

    xtodo

    misc updates:

    Brave browse now has vertical tabs now

    now on own pages. easier to search.

    xtodo read

    big brother email Carlos Fenollosa 2022-11-04 NZRTD
    big brother email Carlos Fenollosa 2022-11-04 NZRTD
    xtodo

    lots updates.

    xtodo
    WolframLang syntax irregularity 2022-10-30 y9Fs2
    WolframLang syntax irregularity 2022-10-30 y9Fs2

    in WolframLang the square bracket is always used as a function argument. it has a systematic grammar. almost no exceptions. x[y] while x is not a function nor x[y] a transformation rule, eval to something, breaks it.

    xtodo

    lots updates.

    added extracting lzip

    more related updates:

    xtodo no rss yet

    ruby install on windows, almost 1 gigabytes.

    ruby install on windows 2022-10-24
    ruby install on windows 2022-10-24
    xtodo

    massive updates and new

    xtodo
    $CharacterEncodings
    a builtin variable. value is a list of character encoding that WolframLang supports. $CharacterEncodings
    $CharacterEncoding
    a builtin variable. value specifies the default encoding to use by input and output functions. Default value is $SystemCharacterEncoding $CharacterEncoding
    $SystemCharacterEncoding
    a builtin variable that specifies the default encoding. on Microsoft Windows 10 as of 2022-10-19, value is "WindowsANSI" $SystemCharacterEncoding
    CharacterEncoding
    an option for some input output functions. CharacterEncoding
    WolframLang import formats 2022-10-19
    WolframLang import formats 2022-10-19

    new and updates

    xtodo

    misc updates

    updated.

    updates.

    updates

    xtodo
    xtodo

    Blog Archive