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,860 other subscribers

whatismylocalip alias (actually more like whataremylocalips) and some sed links

Posted by jpluimers on 2017/01/10

Getting the local IP (actually IPs, but most hosts only have a single IP):

# OS X:
alias whatismylocalip='ifconfig | sed -En '\''s/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p'\'''
# Linux:
alias whatismylocalip='ip a | sed -En '\''s/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p'\'''

I got them via bash – How to I get the primary IP address of the local machine on Linux and OS X? – Stack Overflow

Mac OS X and BSD have ifconfig, but most Linux distributions don’t use ifconfig any more in favour of iproute2, so you use ip a (which is shorthand for ip address show) there.

Their output is similar enough for the sed to work, though. Which surprised be because I didn’t know about the -E option (it lacks in the manual Linux page but it is in the Mac OS X one) which enables POSIX extended regular expressions. In Linux this is documented as -r, but -E also works.

I learned this through the Sed – An Introduction and Tutorial which compares the various versions of sed which also explains about the -n doing no printing.

–jeroen

Posted in *nix, *nix-tools, Apple, bash, bash, Development, Linux, Mac, Mac OS X / OS X / MacOS, Mac OS X 10.4 Tiger, Mac OS X 10.5 Leopard, Mac OS X 10.6 Snow Leopard, Mac OS X 10.7 Lion, MacBook, MacBook Retina, MacBook-Air, MacBook-Pro, MacMini, openSuSE, OS X 10.10 Yosemite, OS X 10.8 Mountain Lion, OS X 10.9 Mavericks, Power User, Scripting, Software Development, SuSE Linux, Tumbleweed | Leave a Comment »

If anyone ever wants to have a batch of LTE dumb phones built…

Posted by jpluimers on 2017/01/09

via: “SF has lost track of buses because SFMTA didn’t upgrade from 2G (to 3G to 4G to LTE) and AT&T finally turned it off.” – Kristian Köhntopp – Google+

If anyone ever wants to have a batch of LTE dumb phones built:

+Jeroen Wiert Pluimers I’m not aware of simple-voice-only phones with LTE modem. From my former life at a telephone producer i remember costs to get a platform running and the effort spend on special editions, i’d say if you are willing to buy 50000 we could find someone producing this for you. In China. But as written above, a basic-2G service (for M2M and emergency signalling or calls) will stay for long.

–jeroen

Posted in Development, Hardware Development, LifeHacker, Power User | Leave a Comment »

How I remember the German word “Urheberrecht”

Posted by jpluimers on 2017/01/09

Los, heb die Uhr auf. Habe ich das Urheberrecht oder du?

Los, heb die Uhr auf. Habe ich das Urheberrecht oder du?

I’m partially word-blind and an learn by association.

So thanks to the below links, I can now remember Urheberrecht:

It’s about Ur, Heber and Recht.

–jeroen

Posted in LifeHacker, Power User | Leave a Comment »

Convert a text value into a date in Excel. Learn Microsoft Excel | Five Minute Lessons

Posted by jpluimers on 2017/01/09

To match dd/mm/yyyy and mm/dd/yyyy column values in columns C (Date1) and N (Date2), I used these formulas in row 2:

Meaning: Column: Formula: Explanation:
Date1Text I =TEXT(C2,”dd/mm/yyyy”) Interpret date text of the original text no matter the Excel settings
Date1Value J =DATE(RIGHT(I2,4),MID(I2,4,2),LEFT(I2,2)) Encode the date text to an actual date: dd#mm#yyyy format where # is any separator
DatesEqual K =J2=L2 Are the encoded dates equal?
Date2Value L =DATE(RIGHT(M2,4),LEFT(M2,2),MID(M2,4,2)) Encode the date text to an actual date: mm#dd#yyyy format where # is any separator
Date2Text M =TEXT(N2,”mm/dd/yyyy”) Interpret date text of the original text no matter the Excel settings

 

Learn how to convert text values into dates in Excel. This lesson covers a range of different scenarios to help you. The comments have even more examples.

Source: Convert a text value into a date in Excel. Learn Microsoft Excel | Five Minute Lessons

Posted in Excel, Office, Office 2007, Office 2010, Office 2013, Power User | 1 Comment »

How to prevent Google Hangouts Chrome extension from popping up for other users of the same Chrome installation? – Web Applications Stack Exchange

Posted by jpluimers on 2017/01/06

Sign out of your Hangout session on your laptop.

  1. Open Hangouts from the Hangouts Chrome extension
  2. The small triangle on the right side.

    The small downward pointing triangle on the right side.

    Click the dropdown menu (the small triangle on the right, just below of the X that close the Hangouts Conversation List window).

  3. Click Sign out of Hangouts

Source: How to prevent Google Hangouts Chrome extension from popping up for other users of the same Chrome installation? – Web Applications Stack Exchange

–jeroen

Posted in Uncategorized | Leave a Comment »

Wifi Analyzer – helped me analyse why an original Chromecast failed to see a Buffalo WLAE-AG300N

Posted by jpluimers on 2017/01/06

Brilliant! Helped me to track down why an original 1st generation Chromecast didn’t want to connect to a Buffalo WLAE-AG300N.

The problem there is that the original Chromecast does only 2.4Ghz WiFi and the WLAE-AG300N favours 5Ghz WiFi over 2.4Ghz when set to auto.

The solution is in the last picture: basically force the WLAE-AG300N to use 11n/g/b only which limits it to 2.4Ghz (it cannot use both frequencies at the same time).

Yes, I know the Microwaves drawback, but as the original Chromecast only does 2.4Ghz. I’d rather get the Chromecast Ethernet adapter but Google refuses to ship these outside the USA.

Source: Wifi Analyzer – Android Apps on Google Play

 

Force the WLAE-AG300N to use only 2.4Ghz

Force the WLAE-AG300N to use only 2.4Ghz

Posted in Chromecast, Google, Power User, WiFi | Leave a Comment »

Delphi and Xcode scary thought

Posted by jpluimers on 2017/01/05

With Xcode updating frequently and Delphi about yearly and often taking more than 1 go at fixing things, you get this scary thought:

Scott Pinkham

I’ve learned to not update Xcode, OSX or iOS until absolutely necessary, and even then I usually stick with an older version of Xcode that is known to be compatible with Delphi. It takes a while for Embaradero/Idera to fix issues every time Apple makes some breaking change. I recommend rolling back to an earlier version if you can.

via: [WayBackHello, I upgraded my Xcode to the latest version 8.2.1 and ios SDK 10.2 Now…

–jeroen

Posted in Delphi, Development, Software Development | 3 Comments »

Delphi To Go: Include resource files in your Delphi build process

Posted by jpluimers on 2017/01/05

Something to remember: Delphi To Go: Include resource files in your Delphi build process

Note it’s not enough to add a line like this to your .dpr file:

{$R 'New1.res' 'New1.rc'}

The resources actually needs to be part of your .dproj file (which basically is an XML msbuild file adhering to the MSBuild Project File Schema Reference).

That way, the BrccCompile target in $(BDS)\bin\CodeGear.Delphi.Targets will automatically pick it up during build.

I just checked and these target files support BrccCompile:

  • ...\Embarcadero\RAD Studio\7.0\bin\CodeGear.Delphi.Targets 
  • ...\Embarcadero\RAD Studio\8.0\bin\CodeGear.Delphi.Targets 
  • ...\Embarcadero\RAD Studio\9.0\bin\CodeGear.Delphi.Targets 
  • ...\Embarcadero\RAD Studio\10.0\bin\CodeGear.Delphi.Targets
  • ...\Embarcadero\RAD Studio\11.0\bin\CodeGear.Delphi.Targets
  • ...\Embarcadero\RAD Studio\12.0\bin\CodeGear.Delphi.Targets
  • ...\Embarcadero\Appmethod\13.0\bin\CodeGear.Delphi.Targets
  • ...\Embarcadero\Studio\14.0\bin\CodeGear.Delphi.Targets 
  • ...\Embarcadero\Studio\15.0\bin\CodeGear.Delphi.Targets 
  • ...\Embarcadero\Studio\16.0\bin\CodeGear.Delphi.Targets 
  • ...\Embarcadero\Studio\17.0\bin\CodeGear.Delphi.Targets 
  • ...\Embarcadero\Studio\18.0\bin\CodeGear.Delphi.Targets

Which means it’s available as of Delphi 2007 until at least Delphi 10.1 Berlin and might even work in Delphi 2006

It could be a little bit flakey in Delphi 2007 (I’ve had many msbuild issues there) but more recent versions should be fine.

–jeroen

Related: I have a big file to add +’ at the beginning of a line and ‘ at the end…- shlomo abuisak – Google+

 

Posted in Delphi, Delphi 10 Seattle, Delphi 10.1 Berlin (BigBen), 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, Resource Files and Scripts (.res/.rc), Software Development | Leave a Comment »

Arduino controlled automated blinds with Web UI

Posted by jpluimers on 2017/01/05

Interesting idea [WayBackArduino controlled automated blinds with Web UI

Via:

–jeroen

 

Posted in Arduino, Development, ESP8266, ESP8266X, Hardware Development, LifeHacker, Power User | Leave a Comment »

Java is not slow – Programmer’s Life : Programmer’s Life

Posted by jpluimers on 2017/01/05

(:

string sender;
sender = "Duda Nogueira";
Programmer: Come on, stop that crap that Java is slow...
Programmer: Wait, I’ll show you my code to prove that Java is not slow. You’ll see it...
Programmer: Wait, the IDE is starting...
Programmer: Just a moment... It’s almost done...
Programmer: Just a little bit... You’ll see how fast it is...
Alex: zzzzzzzz—
T-shirt: Just wait and get a coffee

Source: Java is not slow – Programmer’s Life : Programmer’s Life

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