Asking this because I notice when doing print('${"abc".hashCode}'); on dartpad it gives 102006619, whereas running it locally yields 756227931.
my dart version:
$ dart --version
Dart SDK version: 2.9.0-21.10.beta (beta) (Tue Jul 21 10:46:30 2020 +0200) on "linux_x64"
Then I guess the answer is "no".
Or maybe "it depends", or "it's complicated".
I don't believe Dart has changed the hash code algorithm for strings any time recently, but there is no promise that it won't happen. As such, it is probably stable between versions, but it's not a promise that it stays that way.
However, the algorithm may differ between platforms. Dart2js generated JavaScript, like the one running in DartPad, and native code run no the VM do differ in how they calculate the hash of a string. I don't know if the dev-compiler has a third version, but I'd guess that it's likely to follow dart2js.
Related
I use TOSVersion.ToString function (uses SysUtils) to detect Windows version. However this is what I get in Windows11:
Windows 10 (Version 10.0, Build 21996, 64-bit Edition)
Is there any reliable way to detect Windows 11? I'm using Delphi 10.3.3.
UPDATE: Windows 11 is officially released and I tried again.
Here is what I get:
Windows 10 (Version 10.0, Build 22000, 64-bit Edition)
As Remy pointed out: using the WinAPI you risk of being in some compatibility mode, resulting in getting a version reported that is lower than the actual.
One alternative is to check the file version of expected files, i.e.
%windir%\system32\ntoskrnl.exe or
%windir%\explorer.exe
using GetFileVersionInfo() and VerQueryValue() - the HiWord(dwFileVersionLS)
should be 22000 or higher (according to Windows NT build/release number).
Another is to look in the Registry under HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ at the text values CurrentBuild and CurrentBuildNumber, checking if the highest of both is 22000 or higher.
David already wrote a detailled answer in Checking Windows version on W10 with even more alternatives, although concentrating on the high/low version numbers, not the build. But WMI might help.
(This only works in retrospective with confirmed knowledge.) Check which API exports are available: the idea is that specific functions were introduced with specific Windows releases/versions, so if importing fails for one you know you're on a version below. An outdated example and an outdated list of minimum versions per function will give you an idea. Now you "only" have to find out which new functions are introduced with Windows 11.
Those are all not bulletproof, but you could combine them and then draw conclusions. And after all that you can still try your approach to parse texts instead of relying on numbers only. It also shows how easily you can manipulate your system into reporting different versions as per which method is used.
Official major version number for Windows 11 is 10.
The official build number for the public preview of Windows 11 is
10.0.22000.168
Earlier builds:
10.0.22000.71
10.0.22000.65
10.0.22000.51
Microsoft Windows 11 FAQ
If you want to detect Preview versions, earliest build number was 10.0.22000.51 Windows 11 version history
TOSVersion relies on some hard coded names and logic to return OS name. You will have to implement your own detection, copy and modify TOSVersion record or make wrapper around it, where you can use existing logic for older versions and implement check based on Windows 11 build number to detect Windows 11.
For other general issues and approaches in detecting OS version you can refer to AmigoJack's answer
Except the very weak, atleast for me, solution of considering Windows 10 builds greater than 22000, such as Windows 11, the only solution I found which is actually working is the WMIs Win32_OperatingSystem class - Caption property.
On my dev Win10 machine, it gives the following string: Microsoft Windows 10 Pro.
On my another dev machine, with Win11 installed, the same function gives: Microsoft Windows 11 Pro.
The difference is in string values - "10" vs "11"- but this is at least something far better than the "build greater than" solution.
C# and C++ work well.
The simplest way is to get the version of Kernel32.dll and if Major Version is 10 and Build Version is >= 22000 then you have Windows 11.
See my code here: How can I find the Windows product name in Windows 11?
After a recent upgrade of my Cmake project from C++ 17 from C++ 14, CLion was unable to resolve function calls made on pointers; however, it was still able to resolve function calls on objects. I have reset every possible cache and even done a clean install of the software; however, the IDE does not seem to be able to clear this issue. Is there a fundamental compatibility issue with CLion 2018.1 and C++17?
After installing the early access preview of 2018.1.2, the resolution issues with pointer function calls have been fixed; however, it seems there are still issues with function calls with arguments that are std::optional, it seems any issues with language comprehension are due to C++ 17 and will likely be addressed in future releases.
We need a string-solver and are considering Z3-str or its successor Z3str2. Can these extensions simultaneously be used in conjunction with all the rest of Z3 (i.e. all other theory solvers implemented in Z3)? Or are these string-extensions only usable quasi standalone?
I don't think so, no. Trying to declare a real using Z3-str gives an error. It seems that only strings and ints are supported.
There are other things to consider before using Z3-str as well. It seems to require a slightly different, non SMT-LIB v2 compliant input format. There are example files provided in Z3-str/tests/. They use, for example declare-variable to declare variables rather than declare-const or declare-fun.
There's also some ambiguity in the project about the difference between Z3-str and Z3-str2. Specifically, if you go to the GitHub page then Z3-str2.py is referenced in the build instructions, but there is no such file in the repo, only Z3-str.py. I think what is on the GitHub page is nonetheless the most recent version, because there are commits from Feb 2016.
Finally, Z3-str apparently uses a deprecated API, so you have to use an old version of Z3. So you might not want to build a new project around Z3-str unless you can deal with using Z3 4.1.1 (October 2012).
You are lucky: Z3 currently natively support strings.
Of course, strings can be combined with all other theories.
We have Informix running on our Solaris server and under /usr/informix/bin there are several executables, such as 'dbaccess' and 'isql'.
Each of them produce different version information when typing 'isql -V' for example.
How do you identify the exact version of the SE running?
Output:
'esql -V'
INFORMIX-ESQL Version 6.00.UH1
'isql -V'
INFORMIX-SQL Version 6.03.UC1
'dbaccess -V'
DB-Access Version 7.13.UC1
Then in /usr/informix/release directory there is a file named "SE_7.1". So is it accurate to say that the version of Informix SE we are running is 7.13?
Most likely, you are running SE 7.13; the definitive answer is obtained from:
$INFORMIXDIR/lib/sqlexec -V
However, DB-Access is distributed with SE and would give the correct version unless there was at some time a copy of Informix Dynamic Server (or Informix OnLine Dynamic Server as it would have been labelled back then).
All the software is seriously archaic. Version 6.03 of ISQL was released circa 1996; SE 7.13 would be a little earlier, if anything. The ESQL/C was probably released in 1995; 6.00.UE1 was released in 1994 or 1995, and the UH1 release would have been a little later (a couple of fix packs). Formally, none of the software is guaranteed Y2K-compliant; you'd be using SE 7.24 and ISQL 6.05 (or possibly 7.20) and ESQL/C 7.24 as minimum version numbers. However, the problems with SE and Y2K were far less serious than with other versions. The main issue is that the code will add 1900 to 2-digit years, not 2000.
The current version of SE is 7.26; the current version of ISQL is 7.50; the current version of ESQL/C is (don't ask) 3.50.
Just to add to Jonathan's typically exhaustive answer, DB-Access is bundled with the engine, but isql and esql are both separate products. That's why you're getting different answers to the version number request. They're all correct answers to different questions ;-)
I am interested in trying to get a program ported to 64-bit and would like to know if it's even a good candidate for porting. I am a lighting director and have built a SUSE 11.1 Linux box for a program called MagicQ made by Chamsys (http://www.chamsys.be/download.html). I have been working on this for about 6 months now and have all hardware recognised. I am still working on stage visualizers, and I have a separate CPU/board generating the DMX512 code via PoE. I don't think getting it to run in SUSE will be a problem "it was natively built for Ubuntu".
Any help or direction is greatly appreciated!!
Unbuntu and Suse are subtlely different in how things are laid out for file sytems, home directories and such. Usually when you try to install a package on either on you need to use their own package manager programs so that all dependincies are handled and you don't need to manually try to find package 'x' version 'y' and package 'a' version 'b' just to get something working.
If you know that you have all the dependencies covered, and if you have the raw source code, you should be able to just run a compilier against the source code and have it compilied for a 64-bit processor.
Here is a link to the GCC, the GNU Compiler Collection for your reference.
Good luck with your porting project.