Archive for the ‘Java Platform’ Category
Posted by jpluimers on 2020/05/13
Though the shirt is not available on Amazon [WayBack] any more, still – after 25 years – so many recruiters still get it wrong.
Not just recruiters, so: [WayBack] Why is JavaScript called JavaScript, since it has nothing to do with Java? – Stack Overflow, thanks to CMS [WayBack]:
From an interview made to its creator Brendan Eich:
InfoWorld: As I understand it, JavaScript started out as Mocha, then became LiveScript and then became JavaScript when Netscape and Sun got together. But it actually has nothing to do with Java or not much to do with it, correct?
Eich: That’s right. It was all within six months from May till December (1995) that it was Mocha and then LiveScript. And then in early December, Netscape and Sun did a license agreement and it became JavaScript. And the idea was to make it a complementary scripting language to go with Java, with the compiled language.
he continues on the relation of ECMAScript based languages:
JavaScript, was originally named Mocha, later it was renamed to LiveScript, and then to JavaScript.
The LiveScript to JavaScript name change came because Netscape and Sun did a license agreement.
The language was then submitted for standarization to the ECMA International Organization. By that time, Netscape didn’t allow the use of the “JavaScript” name, so the standarized language is named ECMAScript.
JavaScript isn’t actually an open name. Now it’s a trademark of Sun (now Oracle).
There still a lot of confusion, some people still think that JavaScript, JScript, and ECMAScript are three different languages.
ECMAScript is the “standards” name for the language.
JavaScript is technically a “dialect” of ECMAScript, the Mozilla Foundation can use “JavaScript” as the name of their implementations (currently present on the Rhino and SpiderMonkey engines).
In the early days, Microsoft decided also to do what Netscape was doing on their own browser, and they developed JScript, which is also an ECMAScript dialect, but was named in this way to avoid trademark issues.
–jeroen
via: [WayBack] Does it bug you when people say Java when they actually mean JavaScript? https://www.amazon.com/dp/B06Y3XK69B – Jeroen Wiert Pluimers – Google+
Posted in Development, History, Java, Java Platform, JavaScript/ECMAScript, Scripting, Software Development | Leave a Comment »
Posted by jpluimers on 2020/02/26
This post is a reminder to myself that not all mappings from XSD to programming languages are possible.
There are many impossible cases, so this is just a general reminder.
A Delphi specific case for instance is the mapping of enumerations: one reason is that XSD enumerations are case sensitive, but the Delphi language is not: [WayBack] Using XML Enumerations with Delphi XML Data Binding Wizard – Stack Overflow.
More generic examples from my answer to the above question:
- In XSD you can derive from an existing type in two ways: extending it and limiting it. Object Oriented languages only allow you extend when deriving.
- Delphi is not alone in these kinds of limitations. Generating wrappers from XSD schema’s is the field of specialized tools, even in the Java or .NET world.
I’ve seen horrible things with wildcards that are sort of mappable to Java, but not to C#. This could likely go on for much longer…
–jeroen
Posted in C#, Delphi, Development, Java, Java Platform, Software Development, XML, XML/XSD, XSD | 2 Comments »
Posted by jpluimers on 2019/08/07
When it was at the age natural people are allowed to drive in the USA, the .NET framework behaved far less brain dead handling various (especially long or strange) paths: [WayBack] More on new .NET path handling – Jeremy Kuhne’s Blog.
Path handling has frustrated me in many development environments, so I wonder if ones that are beyond the (USA) legal age of drinking follow.
–jeroen
via: [WayBack] Some time ago, the .net developers finally saw sense and removed path normalization and long path limit code in System.IO… Does anybody know if Embarcadero have come to their senses… – David Heffernan – Google+
Posted in .NET, Delphi, Development, Java, Java Platform, Software Development | Leave a Comment »
Posted by jpluimers on 2019/07/16
Design Patterns and Refactoring articles and guides. Design Patterns video tutorials for newbies. Simple descriptions and full source code examples in Java, C++, C#, PHP and Delphi.
Source: [WayBack] Design Patterns & Refactoring.
And indeed a lot of examples in Delphi too; few sites have that: Delphi site:sourcemaking.com.
–jeroen
Via: [WayBack] I stumbled upon this yesterday, very informative, accessible and also with Delphi examples – among other languages. – Steffen Nyeland – Google+
Posted in .NET, C, C#, C++, Delphi, Design Patterns, Development, Java, Java Platform, PHP, Scripting, Software Development | Leave a Comment »
Posted by jpluimers on 2019/04/03
This is so cool: [WayBack] paulcbetts/refit: The automatic type-safe REST library for Xamarin and .NET. It’s inspired by Square’s [WayBack] Retrofit library which does the same for Java.
They basically allow you to use attributes on interfaces to define a type-safe wrapper around any REST interface, then instantiate a connection to it for making calls.
No more manual HttpClient fiddling!
Since it requires only .NET 1.4, you can basically run it on any platform as it’s supported covered by the implementations .NET Core, Mono and the full .NET Framework.
Quite a lot of projects already use it; I got there via the first link:
–jeroen
Via: [WayBack] Exploring refit, an automatic type-safe REST library for .NET Standard https://www.hanselman.com/blog/ExploringRefit… – Jeroen Wiert Pluimers – Google+
Posted in .NET, C#, Development, Java, Java Platform, Software Development | Leave a Comment »
Posted by jpluimers on 2017/12/07
Ah, C. The best lingua franca we have… because we have no other lingua francas. Linguae franca. Surgeons general? C is fairly old — 44 years, now! — and comes from a time when there were possibly more architectures than programming languages. It works well for what it is, and what it is is a relatively simple layer of indirection atop assembly. Alas, the popularity of C has led to a number of programming languages’ taking significant cues from its design, and parts of its design are… slightly questionable. I’ve gone through some common features that probably should’ve stayed in C and my justification for saying so. The features are listed in rough order from (I hope) least to most controversial. The idea is that C fans will give up when I call it “weakly typed” and not even get to the part where I rag on braces. Wait, crap, I gave it away.
Great re-read towards the end of the year: [WayBack] Let’s stop copying C / fuzzy notepad
Via: [WayBack] Old and busted: emacs vs vi. New and hot: Language war, everybody against everybody else. – Kristian Köhntopp – Google+
–jeroen
Posted in .NET, APL, Awk, bash, BASIC, C, C#, C++, COBOL, CoffeeScript, CommandLine, D, Delphi, Development, F#, Fortran, Go (golang), Java, Java Platform, JavaScript/ECMAScript, Pascal, Perl, PHP, PowerShell, PowerShell, Python, Ruby, Scala, Scripting, Software Development, TypeScript, VB.NET, VBScript | 3 Comments »
Posted by jpluimers on 2017/11/30
Interesting: https://github.com/MinBZK/OperatieBRP
[WayBack] The Netherlands saw a big I.T. project meant to deliver a new citizen registry system fail. So they did one thing right. All the source code is now on github… – Jan Wildeboer – Google+
It includes both documentation and source code.
A bit of browsing reveals at least some of the technologies used:
Most of the SQL code seems to be generated.
There are truckloads of .XML configuration files, typical for a Java environment. Some configuration is in .properties files.
–jeroen
Posted in ActiveMQ, Development, Java, Java Platform, MQ Message Queueing/Queuing, Open Source, PostgreSQL, Software Development | Leave a Comment »
Posted by jpluimers on 2017/11/03
Via [WayBack] Graph of programming languages influence poster – nice gift idea for programmers… – This is why I Code – Google+:
A network graph with more than a thousand programming languages connected by influence relations. Highly influential languages like Lisp, Smalltalk, C, Java, Pascal, C++, Haskel or Python are shown as larger circles as compared to languages with little influence on others like PHP or Argh!. / The influence relation data was retrieved from Freebase in 2013. This design available on posters and other products. An awesome gift for programmers who are into digital art. • Also buy this artwork on wall prints, apparel, kids clothes, and more.
[WayBack] “Network Graph of Programming Language Influence – White Background” Posters by ramiro | Redbubble
I wonder how they drew the relations and why certain languages are in certain places.
--jeroen
Read the rest of this entry »
Posted in C, C++, COBOL, Development, Haskell, Java, Java Platform, JavaScript/ECMAScript, LISP, Pascal, Perl, PHP, Python, Ruby, Scripting, Smalltalk, Software Development, Turbo Prolog | Leave a Comment »
Posted by jpluimers on 2017/11/02
Quoted in full because even 2.5 years later, it’s just too funny:
- Python: What if everything was a dict?
- Java: What if everything was an object?
- JavaScript: What if everything was a dict *and* an object?
- C: What if everything was a pointer?
- APL: What if everything was an array?
- Tcl: What if everything was a string?
- Prolog: What if everything was a term?
- LISP: What if everything was a pair?
- Scheme: What if everything was a function?
- Haskell: What if everything was a monad?
- Assembly: What if everything was a register?
- Coq: What if everything was a type/proposition?
- COBOL: WHAT IF EVERYTHING WAS UPPERCASE?
- C#: What if everything was like Java, but different?
- Ruby: What if everything was monkey patched?
- Pascal: BEGIN What if everything was structured? END
- C++: What if we added everything to the language?
- C++11: What if we forgot to stop adding stuff?
- Rust: What if garbage collection didn’t exist?
- Go: What if we tried designing C a second time?
- Perl: What if shell, sed, and awk were one language?
- Perl6: What if we took the joke too far?
- PHP: What if we wanted to make SQL injection easier?
- VB: What if we wanted to allow anyone to program?
- VB.NET: What if we wanted to stop them again?
- Forth: What if everything was a stack?
- ColorForth: What if the stack was green?
- PostScript: What if everything was printed at 600dpi?
- XSLT: What if everything was an XML element?
- Make: What if everything was a dependency?
- m4: What if everything was incomprehensibly quoted?
- Scala: What if Haskell ran on the JVM?
- Clojure: What if LISP ran on the JVM?
- Lua: What if game developers got tired of C++?
- Mathematica: What if Stephen Wolfram invented everything?
- Malbolge: What if there is no god?
–jeroen
Read the rest of this entry »
Posted in .NET, APL, Assembly Language, BASIC, C, C#, C++, COBOL, Development, EPS/PostScript, Fun, Go (golang), Java, Java Platform, JavaScript/ECMAScript, LISP, Makefile, Pascal, Perl, PHP, Python, Quotes, Ruby, Rust, Scala, Scripting, Smalltalk, Software Development, T-Shirt quotes, TCL, Turbo Prolog, VB.NET, Visual BASIC, XML/XSD, XSLT | Leave a Comment »
Posted by jpluimers on 2017/08/03
Interesting for anybody working on list growth strategies.
In this case with some Delphi background information and in depth coverage of FastMM memory (re)allocation strategies.
[WayBack] Stefan Glienke (of [WayBack] Spring4D fame) needed some help with allocation strategies and observed the difference between:
TList.Grow (and TStringList.Grow) growing like this: 4, 8, 12, 28, 44, 60, 76, 95, 118, 147, 183, 228, 285, 356, 445, 556, 695, 868, 1085
- Generic
TList<T> growing the same way as the .NET List<T>: 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024
There is this nice [WayBack] Dynamic array – Growth factor – Wikipedia, the free encyclopedia mentioning this table:
[WayBack] Javier Hernández mentioned he doesn’t think exponential is better than n^2.
[WayBack] Eric Grange (of [WayBack] DWS and [WayBack] beginend.net fame) mentions he tends to use 1.5, it is about as good as 2 for small lists, but reduces waste for large ones. He also uses a constant delta to accelerate growth early on, so something like:
n := n + (n div 2) + 8
Since allocation strategies highly depend on the memory allocator as well, I was glad [WayBack] Primož Gabrijelčič (of [WayBack] OnmiThreadLibrary and [WayBack] Smart Mobile Studio fame) elaborated on FastMM:
- FastMM small block allocator sizes (size includes the leading header) are: 8, 16, 24, 32, … 160 (in +8 steps), 176, 192, … 320 (+16), 352, 384 … 480 (+32), 528, 576, … 672 (+48), 736, 800, 880, 960, 1056, 1152, 1264, 1376, 1504, 1648, 1808 , 1984, 2176, 2384. [FastMM4.pas, SmallBlockTypes global var]
- While the size of reallocated region fits inside a small block (with a different size than a previous block), the data is moved around (new block is allocated from a new suballocator). If it is too big (>2384 bytes), it gets allocated from the medium block allocator (which handles all block sizes up to 264752 bytes; larger blocks come directly from VirtualAlloc).
- When small blocks are reallocated (to a larger size), allocator always allocates at least 100% + 32 bytes larger block, even if less is requested by the RTL (example: 8 bytes will grow to 2*8 + 32 = 48 bytes). When medium blocks are reallocated, allocator always allocates at least 125% of the old size. This boosts the performance when blocks are enlarged by small values as they can be enlarged “in place” (no data moved around, just the header is adjusted).
Stefan Glienke and Primož Gabrijelčič then concluded that:
- Resizing an array from say 4 elements (pointer size) to 1000 (in multiple steps) will for sure move several times when jumping from one region into the next larger one.
- Changing to a growth factor of 1.5 vs 2 won’t change anything in terms of memory fragmentation in FastMM4.
Source: [WayBack] I was just looking at TList.Grow (and TStringList.Grow) and I realized that the…
Edit 20181127
Delphi 10.3 Rio makes this configurable in a global way for all threads at the same time (#facepalm! as it is the 1980s Turbo Pascal ExitProc mess all over again): [WayBack] Delphi RTL Improvements in 10.3 Rio via [WayBack] +Marco Cantù is unstoppable. I can’t keep up LOL – Clement Doss – Google+
The SetGrowCollectionFunc is of course not documented in the RTL, only in the [WayBack] What’s New – RAD Studio 10.3 Rio: [WayBack] Search results for “SetGrowCollectionFunc” – RAD Studio 10.3 Rio.
Stefan Glienke commented in that G+ thread:
I recently experimented with different grow factors and while the memory fragmentation can only mitigated for medium and large blocks (where it actually matters imo) it might be beneficial to only grow by 1.5 at that point. But that has yet to be tested.
What I liked so far is the grow strategy that Go uses (2x until 1024, 1.25x after that) – see
https://golang.org/src/runtime/slice.go#L115
Since you usually set the size upfront if you add many elements at once (well, if you know how many beforehand) the grow strategy only matters in the long run. You want to balance speed (too many realloc might slow things down unnecessarily), memory overhead (if you are overallocating much you risk wasting too much memory) and memory fragmentation (which might happen with a grow factor bigger than the golden ratio)
–jeroen
Posted in .NET, Delphi, Development, Java, Java Platform, Software Development | 7 Comments »