The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,862 other subscribers

Delphi: rbTC1416 package cannot find the Graphics unit: ensure your DCC_Namespace is correctly

Posted by jpluimers on 2017/02/02

I had to add this to my DCC_Namespace in the rbTC1416.dproj file to make it build under Delphi XE8:

Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;

The occurrence of this DCC_Namespace setting corresponds to the “Unit scope names” of the “All configurations – All Platforms” target in the project options.

That got rid of this error mesage:

[dcc32 Fatal Error] ppChrt.pas(17): F2613 Unit 'Graphics' not found.

It was for a site that had very little ReportBuilder but a truckload of FastReports stuff, so I temporarily needed their ReportBuilder for XE2 to just load in Delphi XE8 at design time so I could migrate.

Apparently not all the ReportBuilder packages use the same namespace definitions. Even worse: they add various namespaces at various target levels in an inconsistent way, so it took me a bit more time than I originally hoped for sorting this out.

Below is what the original settings were: only the .\TeeChart\Win32\TeePro900 directory had TeeChart project files (the .\Source and .\TeeChart\Win32\TeeStd900 directories hadn’t) and all three had slightly different unit source files for TeeChart support.

Read the rest of this entry »

Posted in Delphi, Delphi XE8, Development, Software Development | Leave a Comment »

some links on git and code reviews

Posted by jpluimers on 2017/02/02

A few links I collected:

–jeroen

Posted in Agile, Code Quality, Code Review, Development, DVCS - Distributed Version Control, git, Software Development, Source Code Management | Leave a Comment »

When the x86 Server JVM.DLL cannot be found

Posted by jpluimers on 2017/02/02

Searching for the below error message didn’t reveal useful results.

Error: missing `server' JVM at `C:\Program Files (x86)\Java\jre1.8.0_111\bin\server\jvm.dll'.
Please install or use the JRE or JDK that contains these missing components.

First the actual solution

[WayBackSetup Elasticsearch | Elasticsearch Reference [5.1] | Elastic provided this solution that was introduced in[WayBackSetup Elasticsearch | Elasticsearch Reference [5.0] | Elastic:

Elasticsearch ships with default configuration for running Elasticsearch on 64-bit server JVMs. If you are using a 32-bit client JVM, you must remove -server from jvm.options and if you are using any 32-bit JVM you should reconfigure the thread stack size from -Xss1m to -Xss320k.

I had a 32-bit JRE installation as browsers usually are 32-bit and that’s what my Java need originated from.

So I edited config\jvm.options with this change:

49a50,51
> ## see https://www.elastic.co/guide/en/elasticsearch/reference/current/setup.html
> ## prevent errors like Error: missing `server' JVM at `C:\Program Files (x86)\Java\jre1.8.0_111\bin\server\jvm.dll'.
51c53
< -server
---
> # -server

Note I left out the -Xss1m change out as that entry wasn’t present in config\jvm.options (which is odd, but hey: documentation is always behind on code).

In a server environment, I’d probably not run Elasticsearch on Windows but on Linux and there all my software is x64 so the error should not happen.

Solving the 2 gigabyte memory limit

Immediately after trying this, I got an error about memory size:

Error occurred during initialization of VM
Could not reserve enough space for 2097152KB object heap

The reason is that in the same config\jvm.options file, elasticsearch reserves 2 gigabyte of heap space which on either experimental or 32-bit systems is an enormous amount of memory. So I made this change:

22,23c22,25
< -Xms2g
< -Xmx2g
---
> #-Xms2g
> #-Xmx2g
> -Xms1g
> -Xmx1g

Back to my search

The search for elasticsearch “Error: missing server' JVM atC:\Program Files (x86)\Java\” only revealed one result [WayBackSearch Lucene – pointing to [Archive.is as WayBack fails to saveES 5.0 Alpha 3 error on starting up engine – Elasticsearch – Discuss the Elastic Stack with this content:

I have installed ES 5.0.0 Alpha 3 and try to start it up. However, it gives me the following result.

Error: missing `server' JVM at `C:\Program Files (x86)\Java\jre1.8.0_91\bin\server\jvm.dll'.
Please install or use the JRE or JDK that contains these missing components.

It didn’t happen to my another version of ES. Is there any errors for it?

12 DAYS LATER

Hi,

does this work now? This seems to be a problem with Oracle JRE on Windows. The respective page6says:

    jre\bin\server\
        On Microsoft Windows platforms, the JDK includes both
        the Java HotSpot(TM) Server VM and Java HotSpot Client VM.
        However, the Java SE Runtime Environment for Microsoft Windows
        platforms includes only the Java HotSpot Client VM. Those wishing
        to use the Java HotSpot Server VM with the Java SE Runtime
        Environment may copy the JDKs jre\bin\server folder to a 
        bin\server directory in the Java SE Runtime Environment. Software
        vendors may redistribute the Java HotSpot Server VM with their
        redistributions of the Java SE Runtime Environment.

I suggest you just install a JDK. Then you should be fine (or you use the workaround they suggest).

Daniel

Or directly from the [WayBackJRE 8 README:

      bin\server\       On Microsoft Windows platforms, the JDK includes both
                        the Java HotSpot™ Server VM and Java HotSpot 
                        Client VM. However, the Java SE Runtime Environment 
                        for Microsoft Windows platforms includes only the 
                        Java HotSpot Client VM. Those wishing to use the 
                        Java HotSpot Server VM with the Java SE Runtime
                        Environment may copy the JDK's jre\bin\server folder 
                        to a bin\server directory in the Java SE Runtime 
                        Environment. Software vendors may redistribute the 
                        Java HotSpot Server VM with their redistributions of 
                        the Java SE Runtime Environment.

–jeroen

Posted in Development, Java, Java Platform, Power User, Software Development | Leave a Comment »

Delphi compiler: the –depends switch / DCC_OutputDependencies property outputs a .d file listing all .dcu and .dcp files – via Stack Overflow/G+

Posted by jpluimers on 2017/02/01

Every now and then you want to know what units your project is made of. Not just the units require to build your project, but actually the ones ending up in the executable (i.e. not removed by the compiler or linker).

I had long forgotten that Chris Hesik  [WayBack] wrote in debugging – How can I find all the units in my Delphi app? – Stack Overflow  [WayBack]:

you can have the Delphi compiler show you a list of used .dcus by passing –depends when you compile a project. It will output a .d file with a list of the .dcus (and .dcps) that were required.

This reminded me of that: The –depends option is supposed to work with the Delphi compiler, and it outputs a .d file. Does it still work in Berlin, and where is the file supposed to be output to? – David Nottage – Google+  [WayBack]

In the mean time, I wrote a batch file that parses the .MAP file to see which units actually made it into your .EXE  [WayBack] which works only for Widows executables (as I hardly do cross-platform Delphi development).

Uwe Schuster [WayBack] reported the IDE won’t pass on the –depends switch in Delphi XE and up (version 15.0.3953.35171) [WayBack] which means you need to pass this from the command-line.

Ondrej Kelle (G+/SO) pointed out that:

msbuild hello.dproj /property:DCC_OutputDependencies=true

  • It does work from the IDE if you check “use MSBuild externally”

The msbuild property setting is available in at least Delphi/C++Builder versions 2007 and 2010..Berlin as it is in CodeGear.Cpp.Targets and CodeGear.Delphi.Targets/RTL.Build.targets for BDS versions 5, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17 and 18. It might be available in versions 2005/2006/2009 as well but I don’t have these lying around any more.

–jeroen

Read the rest of this entry »

Posted in Delphi, Delphi 10 Seattle, Delphi 10.1 Berlin (BigBen), Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Delphi XE8, Development, QC, Software Development | Leave a Comment »

Some ChromeCast URLs

Posted by jpluimers on 2017/02/01

I need to check these against a Chromecast v2 as the below URLs are from a v1 device:

More is possible by using cURL: Chromecast Hacking Has Begun | fiquett.com

sleep 8h; while true; do
curl -H "Content-Type: application/json" http://192.168.71.113:8008/apps/YouTube -X POST -d 'v=somevideo';
done

Related:

–jeroen

via:

Posted in Chromecast, Communications Development, Development, Google, Hardware Interfacing, HTTP, https, Internet protocol suite, REST, Security, TCP | 3 Comments »

pi-hole/pi-hole: A black hole for Internet advertisements (designed for Raspberry Pi)

Posted by jpluimers on 2017/01/31

pi-hole – A black hole for Internet advertisements (designed for Raspberry Pi)

Works on most Debian distributions as well. Hopefully on opensuse one day as well.

Source: pi-hole/pi-hole: A black hole for Internet advertisements (designed for Raspberry Pi)

Not exactly the nicest way of installing though:

curl -L install.pi-hole.net | bash

Source: Pi-Hole: A Black Hole For Internet Advertisements

Source: In the past year, a similar threat has begun to emerge on mobile devices:…

Note that any ad-block mechanism needs curation to white/black list some stuff. But: who does that and who watches the curators?

Source: In the past year, a similar threat has begun to emerge on mobile devices: So-called overlay malware that impersonates login pages from popular apps and… – Jeroen Wiert Pluimers – Google+

via:

Some more links for when you get this going:

Changing hostname

As all raspbian hosts advertise their hostname as raspberrypi it is confusing to set them apart, so I changed the hostname in these files:

/etc/hostname
/etc/hosts
/etc/wicd/wired-settings.conf
/etc/wicd/wireless-settings.conf

Then rebooted (probably could have done sudo /etc/init.d/hostname.sh) to force the new hostname to be used everywhere.

DHCP versus static IP

Note that pi-hole by default converts the DHCP assigned address on eth0 to a static one. This makes it harder to use pi-hole in these situations:

  • preparing a pi-hole on network A and deploying it on network B
  • using pi-hole on a DHCP based network where the DHCP server hands out fixed IP addresses based on MAC

To get going I:

  1. filed an issue Work with DHCP address instead of static IP address configuration. · Issue #629 · pi-hole/pi-hole
  2. plugged in the Edimax EW-7811Un 150Mbps 11n Wi-Fi USB Adapter  which appeared as wlan0 in the ifconfig list
  3. failed in getting wicd-curses to work: it would only detect half of the WiFi networks that iwlist wlan0 scan detects.
  4. used the steps at Setting WiFi up via the command line – Raspberry Pi Documentation to get WLAN going:
    1. perform sudo iwlist wlan0 scan | grep ESSID scan to get a list of networks and their (E)SSID names
    2. append the below fragment to the end of /etc/wpa_supplicant/wpa_supplicant.conf and correct the value for ssid to the ESSID (keep the double quotes around it) and psk to the password for that ESSID (also keep the double quotes around it)
    3. performed sudo ifdown wlan0  and sudo fup wlan0 to force a WiFi connection refresh
    4. waited 30 seconds for a DHCP address to appear in ifconfig for wlan0
network={
    ssid="The_ESSID_from_earlier"
    psk="Your_wifi_password"
}

 

 

–jeroen

Read the rest of this entry »

Posted in *nix, bash, Development, Linux, openSuSE, Power User, Scripting, Software Development, SuSE Linux, Tumbleweed | 1 Comment »

Instantly convert curl commands to Go code: https://mholt.github.io/curl-to-go/

Posted by jpluimers on 2017/01/31

Instantly convert curl commands to Go code: curl-to-Go: Convert curl commands to Go code at https://mholt.github.io/curl-to-go/

via: Instantly convert curl commands to Go code: bit.ly/1PJprPV – nifty tool!

–jeroen

Posted in *nix, cURL, Development, Go (golang), Power User, Software Development | Leave a Comment »

March ‘Rosehill’  – Enfield Citadel Band – YouTube

Posted by jpluimers on 2017/01/30

Interesting piece of music: March ‘Rosehill’  – Enfield Citadel Band – YouTube

We’re going to play this as well.

–jeroen

Read the rest of this entry »

Posted in About, Adest Musica, Personal | Leave a Comment »

Reducing the size of your Windows.edb (Search) and DataStore.edb (Update) databases

Posted by jpluimers on 2017/01/30

Windows Search: Windows.edb

If you use Windows Search (I don’t: I use Everything by VoidTools), your Windows.edb can grow ridiculously large. It is a single file, though it appears to be in two places because there is a symbolic link from C:\Users\All Users to C:\ProgramData :

C:\ProgramData\Microsoft\Search\Data\Applications\Windows\Windows.edb
C:\Users\All Users\Microsoft\Search\Data\Applications\Windows\Windows.edb

This is how to reduce its size:

How to offline defrag the index

  1. Change the Windows Search service so that it does not automatically start. To do this, run the following command in cmd.exe:
    sc config wsearch start= disabled
  2. Run the following command to stop the Windows Search service:
    net stop wsearch
  3. Run the following command to perform offline compaction of the Windows.edb file:
    esentutl.exe /d %AllUsersProfile%\Microsoft\Search\Data\Applications\Windows\Windows.edb
  4. Run the following command to change the Windows Search service to delayed start:
    sc config wsearch start= delayed-auto
  5. Run the following command to start the service:
    net start wsearch

Notes:

  1. I did not perform the last 2 steps as I’ve kept Windows Search disabled.
  2. If you want to reduce the size of the C:\ProgramData\Microsoft\Search\Data\Applications\Windows\Projects\SystemIndex\Indexer\CiFiles\ directory:
    1. Before step 1, choose what kind of Windows Search indexing options you want
    2. Between step 3 and 4, delete the directory

Windows Update: DataStore.edb

Windows Update uses the same database structure and is a single file:

C:\Windows\SoftwareDistribution\DataStore\DataStore.edb

This is how I reduced its size:

net stop wuauserv
net stop bits
esentutl.exe /d C:\Windows\SoftwareDistribution\DataStore\DataStore.edb
net start bits
net start wuauserv

Talking about Windows Update: you might also want to Clean Up the WinSxS Folder

–jeroen

Read the rest of this entry »

Posted in Everything by VoidTools, Power User, Windows, Windows 10, Windows 7, Windows 8, Windows 8.1, Windows 9, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2, Windows Vista | Leave a Comment »

DIY pick and place machine from parts of scanner, inkjet printer, DVD player and vaccuum pump – Open Theremin – Urs Gaudenz

Posted by jpluimers on 2017/01/30

Urs Gaudenz manufactures Open.Theremin kits using his do it yourself pick and place machine which he built from low cost scanner, ink jet printer, DVD player mechanics and some Arduino controlling. Even his solder oven is Arduino controlled!

This is months of work showing a work flow in a 11 minute youtube video. Well done!

via:

Video:

Read the rest of this entry »

Posted in Arduino, Development, Geeky, Hardware Development | Leave a Comment »