Subscribe via RSS

China, 2018 – Shanghai and Guangzhou

China Southern had a great deal on return flights to Amsterdam, but the return leg included an inconveniently-timed 10-hour stopover in Guangzhou. Instead of this, I re-routed via Shanghai and decided that an overnight bullet train trip was in order. It's really the only thing that China has done over Japan, the building of high-speed beds! Well.. I lie. I wrote that last sentence prior to going and now that I'm back I'm seriously impressed with the culture, technology and overall livability of China. It was very different to when I was there 15 years ago!

Getting a Tourist Visa

So, Australia ain't on the cool-list. As an Australian, you'll have to fill out the application form and either post it to the consulate or deliver it in person to the application center. I chose the latter and, expecting that I had all the correct information, rocked up without an appointment on a Thursday lunch-time. After a 2.5hr wait, I was told that I needed print-outs of my hotel reservations. I'd totally neglected to read the requirements.

I returned to work and decided to choose some hotels later that night. Once done, I made the smart move and actually booked an appointment. DO THIS! DO NOT VISIT THE CENTER WITHOUT AN APPOINTMENT! With everything on me, I rocked up the following Monday and still had to wait for around 40 minutes. Once called up, all information was accepted and I was handed a receipt with an expected completion date. This was the following Thursday and, upon arrival, I waited in line to receive my passport with its pretty new Visa installed. AUD$109.95 later and I was set!

So, the basic idea is: Book EVERYTHING before you go and apply for a Chinese Visa. The form actually requires you to record where you are each night of your trip, so make sure you have the appropriate evidence per day.

Shanghai

This city is crazy... I stayed right in town at the Raddisson 'Tru Blu' and enjoyed it. The location was great for walking Nanjing Road to the Bund and also for getting a train to the computer area. Unfortunately the markets were really only full of new stuff. The area was pretty cool though with the overhead metro lines and grotty markets/streets. Check this link at Wikia for more information.

DSC 0495 DSC 0497 DSC 0498

I had a friend help me work out cool places to check out trains. We were advised that the station platform at Lianhua Road Station on Subway Line 1.

The line parallels the actual main railway and there are two flat concrete platforms out from the station roof that you can use as viewpoints. Either gives a clear view in one direction and not the other. I was really happy though, there was a good mix of loco-hauled and high-speed trains through in the 30 minutes we hung around.

DSC03611 DSC03613 DSC03625

DSC03612

DSC03615 DSC03627 DSC03640

DSC03630 DSC03634 DSC03636

DSC03642 DSC03644 DSC03657

After this is was shopping, shopping and more shopping. Oh, and eating! Go to Da Dong for the most amazing Peking Duck.

The Overnight Bullet Train

After travelling on the Twilight Express, Kitaguni and Hokutosei... even the XPT in Australia and the Bangkok - Chiangmai Sleeper Train, it was time to ride the 'Deluxe Sleeper' from Shanghai to Guangzhou. This was going to be a 1400km coastal trip (not unlike the Twilight Express) with very convenient departure and arrival times.

This service only runs on Fridays, Saturdays, Sundays and Mondays, so make sure to plan your trip around the timetable. It seems that there's no demand mid-week and therefore does not run. Here's a recent Friday timetable.

DSC 0500

DSC 0501 DSC 0502 DSC 0503

The trains and stations were enormous and astonishing (that first photo above is from the mezzanine in the waiting area of Shanghai Hongqiao.) Just the sheer scale made them impressive. I must admit that the passengers were also very well behaved, when compared with normal public interactions. Everything felt a lot more like an airport than a train station. Most stations also had 16-or-more platforms with trains heading in numerous directions. Unfortunately, the waiting area was above the platforms and you only got to see the trains when you were called to board.

DSC 0507 DSC 0506 DSC 0509

The consists were clean and tidy. It was funny looking at each of the models and thinking like I'd seen them before. Some were kawasaki-styled, others siemens-styled. Either way they all (well, except the very latest with its red livery) had the same white/black/blue colour schemes. Train after train departed and arrived at Shanghai and it was amazing to watch.

DSC 0505 DSC 0520 DSC 0518

The cabins themselves were very similar to those of both Thailand and Japan. Everything was very shiny and new, but the tech wasn't overly 'premium'. The beds were already down and made, although it was already 2030.

DSC 0534 DSC 0526 DSC 0535 DSC 0537 DSC 0538

Each bed had a TV, reading light, control panel and ample bedding. It was all looking very comfortable, except for the couch, which was a little hard and facing backwards... but that was luck of the draw as even-numbered cabins would've had the couch facing the other way. Anyway, it was dinner time...

DSC 0515

DSC 0512 DSC 0513 DSC 0514

DSC 0516

The buffet car was next door and felt comfortable enough. It actually reminded me of my KTMB trip from Butterworth to KL. Nice and clean, boxes of stock piled high, very spartan outfit but functional and a simple menu. All items were 'bento' style and re-heated in the industrial-strength microwave. I chose the fish and suffered through a lot of tiny bones; still delicious!

DSC 0529 DSC 0531 DSC 0532 DSC 0527 DSC 0522

Back to the cabin via the cute decor... there's a temperature control next to the door to make sure you have a comfortable sleep... although the upper berth may receive the majority of the aircon. Note that cabin number one (and the other end, I think 10? or 12?) are right next to the toilet. They're airplane toilets as well... so thanks to thin walls you can feel when people flush next to you.

The trip was fantastically timed and really easy. There was only one really major fault that I believe I may still be suffering from. The pressurisation of the carriages wasn't working. You could tell as soon as we were entering a tunnel as your ears would start to pop. And I don't mean just once... I mean about 5 times on entry and twice on exit of each tunnel. Worse when there was an opposing train! Even when lying down and sleeping I was awoken to aching eardrums once or twice.

Guangzhou

We arrived into Guangzhou at 7am on a Tuesday and dumped my bags at the hotel. I ended up staying at the Royal Mediterranean Hotel in the Gang Ding area of Guangzhou... nice and close to all of the IT markets! It was too early to go shopping, so we ventured for the Canton Tower. This had an awesome observatory with a freakin' ferris wheel on the top!

Anyway... the days were mainly spent scouring through IT markets... but, of course, the effort was put in to ask the community where a good photography point would be. Turns out this one was a bit dicey. My friend was a local and declared that we could enter the area... but I was a little wary. We ended up taking Didi (Chinese Uber) and then riding the rental bikes to a rural area.

This area was known as the Xinshi Residential Area, or so I think? The maps are a little hard to work out. Either way, it was a side-road to a depot for track machines.

DSC03659

DSC03660 DSC03662 DSC03663

DSC03831 DSC03832 DSC03834

So.. yeah... after checking out the wagons, we *ahem* 'navigated' a fence and were presented with a fantastic line-side opportunity. Here's the northern view...

DSC03667

And then the southern view...

DSC03669

From here it was train-after-train-after-train. Seeing the signals helped a lot too. And this time there was freight! No high-speed though.

DSC03673

DSC03671 DSC03674 DSC03678

Lots of passenger consists... going to (or coming from) some very far reaching places!

DSC03682

Ahhhh... diesel freight... nothing better...

DSC03684

The passenger consists were actually seriously long. Turns out there was a bit of congestion too.

DSC03694

DSC03689 DSC03698 DSC03699

DSC03712 DSC03701 DSC03702

DSC03713

DSC03721

DSC03727

DSC03731 DSC03740 DSC03744

DSC03750

DSC03759 DSC03763 DSC03768

DSC03770

And then a final freight...

DSC03804

DSC03811 DSC03814 DSC03816

DSC03820

And finally... a puppy in a box...

DSC03828

...he wasn't a happy camper.

China Southern

One final note.. China Southern is a fantastic airline. Three of the four legs of the trip to Amsterdam were on seemingly-brand-new Airbus A330s and the staff and food were fantastic. The leg from Amsterdam to Shanghai was actually operated by KLM, so that was also a nice surprise.

DSC 0566

The final surprise was having the pilot draw a ring around the word 'Guangzhou' on the map as we departed for Melbourne. Things were amiss when we started heading west... I nearly thought I was in for another European holiday. We then veered south and I assumed we were to loop back and land in Guangzhou. But then as we swung around, out to the east was the most amazing storm-cell, smashing lighting in every direction. Fortunately this was well away from us and was exactly what the pilot was trying to avoid!

8Jun/180

Arduino – How to save power (and control 5v+)

For the first time ever, I get to play with Arduino at work! We're doing a little bit of work on tracking and the goal is to acquire as much data as possible and report it to a webserver. Therefore I've got sensors, GPS and GSM. As one can imagine, this consumes a lot of power, and as one can also imagine: the goal will be to obtain as long of battery life as possible.

Each of the modules requires either 3.3v or 5v and these are usually hardwired into the power supply. They also require anywhere from 50mA to 2A (GSM when sending data or searching for signals) and therefore can't be controlled directly from pins on the Arduino. Due to this I'll explain a proper mechanism to switch their power supplies on and off. Also, we'll then want to dig into power saving on the Arduino itself, so stick around.

Controlling modules from Arduino digital pins

Digital pins on the Arduino are only good for 30mA maximum. In fact, you shouldn't even be going anywhere near this. Hence, using one to provide +5v or GND to a module will cause that module's current needs to flow through the pin. For example, the GPS module I bought from Jaycar needs anywhere from 0-70mA. Although low, this is still too high for a digital pin.

The goal therefore is to use an electronic switch. You might be thinking 'relay', but you'll also need to note that they require current which can peak above the digital pin tolerance! You'll find that relay modules don't connect the relay actuator to the input.

arduino-5v-control

The answer here is to use a transistor to allow current to flow to your modules. Depending on your current requirement, I can either recommend a 2N2222 (for anything up to 600mA) or a TIP31 (good for 3A.) I also want to switch my GSM module, and that needs 2A, so I bought a handful of TIP31s.

Using them is very straight-forward. Connect your VCCs up to whatever power source is needed and embed the transistors in the ground path. From here, switching the digital pin high will let current flow and complete the circuit for the module. Make sure you set your digital pinMode to OUTPUT.

Ideas for saving power via code

The basic idea is to put the Arduino to sleep whenever there's nothing to do. My device only needed to report every 15 minutes, so in the meantime I tried to make it snooze. It turns out that, based on internal timers and interrupts, you can only get a maximum of 8 seconds power down out-of-the-box. This wasn't quite the 15 minutes I was looking for, but numerous sources online said to just keep putting the unit to sleep for 8 seconds over-and-over.

There's some great reading here by Nick Gammon on power saving. Anything from lower frequencies to shutting down certain parts of your project. You'll also find a blog post here at the Arduino Playground describing other options. Just make sure you read that entire second article as other contributors have made corrections or other important points. Tis great to see the community involved.

...I'll come back to power saving once the project gets started up again. The proof-of-concept worked and now we need to convince the powers-that-be to let us continue.

Filed under: Arduino No Comments
7Jun/180

Arduino – Don’t buy the SIM900A for Australia!

tl;dr = This is a 2G-only device. There's only one network left, which shuts down on the 30th of June, 2018!

...but I needed a connection for work and I bought this unit from a seller on eBay without researching... so... compounding the error, I then also bought a SIM card for the network that'll still work: Vodafone. Thanks to Happymacer on Instructables who posted an article discussing how to use this device in Oz!

Note that I'd previously tried to use both Optus and Telstra SIM cards and got the following output when running the COPS command.

AT+COPS=?
+COPS: (3,"VODAFONE","voda AU","50503"),,(0-4),(0-2)
OK

Yey! Vodafone! But I'm on Telstra/Optus? So I can see a Vodafone tower, but it's prepended with 3 which actually means I'm not allowed to use it. Sorta makes sense as Optus and Telstra switched off their 2G networks ages ago and Vodafone must have decided that lingering devices on other companies' plans aren't allowed to use their towers.

I bought a Vodafone SIM and ran the commands again...

AT+COPS=?
+COPS: (2,"VODAFONE","voda AU","50503"),,(0-4),(0-2)
OK

Woweee! It's there. 2 means Roaming... which is a little weird, but it must be trying to hint to my device that 2G isn't the best method and that there should be a 3G tower around somewhere. Of course, even if there was, we couldn't connect to it. So I forced the connection with the following command...

AT+COPS=1,2,"50503"
+CREG: 2
+CREG: 1
OK

Those CREGs afterwards were output because I had previously run AT+CREG=1. This command tells the device to report any changes to the carrier connection. What you can see is it connecting to the tower in roaming mode (aka 2) and then connecting correctly in local mode (aka 1.) We're on!

Testing SMS

If you wanna test an SMS, then you can do so pretty easily. Rig up a SoftwareSerial example in Arduino and make sure you can send commands to the SIM900A via the Serial Monitor. From here, you can use the following script to send an SMS.

AT+CMGF=1
OK
AT+CMGS="+61xxxxxxxxx"
>

Note above ... you'll get the > prompt to enter the message. Once you're done, the unit requires a CTRL-Z control character to realise it's the end of the message. To do this, you'll need to open your favourite text editor, type ALT+026 (hold down ALT and type 0 then 2 then 6) and then copy the resulting character. It will be a black SUB if you use Notepad++. Now paste this into the text entry field in the Serial Monitor and hit enter.

Sending Data

From here, Jens Christoffersen at All About Circuits has helped us greatly with his article: Using a SIM900A to Send Sensor Data to a Website. Scroll down far enough and you'll find his code to send data to a server. He uses printf statements, as he's using a PIC and talking direct to the serial port... we'll have to use SoftwareSerial and print(ln).

AT+CGATT=1
OK
AT+SAPBR=1,1
OK
AT+SAPBR=2,1
+SAPBR: 1,1,"100.84.75.204"
OK
AT+HTTPINIT
OK
AT+HTTPPARA="URL","http://www.website.com/index.php?data1=1&data2=4"
OK
AT+HTTPPARA="CID",1
OK
AT+HTTPACTION=0
OK
+HTTPACTION: 0,200,0
AT+HTTPTERM
OK

Above is an example chat with the unit to send data. Paste each AT line into the Serial Monitor first to make sure you get the expected responses. The URL above is rubbish, so put one in that'll work properly instead. The 200 in the HTTPACTION response is the happy HTTP code.

Filed under: Arduino No Comments
1Jun/180

Germany, 2018 – Kassel and Leer

Thanks to hiring a car and touring Germany, I was able to visit some cool places like Miniatur Wunderland! Smashing the rental Jaguar XF on the autobahn was also fun... I was actually a little disappointed that the diesel didn't want to push much faster than 220km/h. The tour also took us on some back-roads as there were bridgeworks east of Bochum.

DSC02994

I can't even tell you where the above photo was taken as I was too busy negotiating bumper-to-bumper traffic on tiny country roads... but a freight passed a few seconds before and I was hoping to catch another.

Kassel

The first night of the roadtrip was spent in Kassel. We hadn't booked in advance, so I chose the hotel closest to the station. This turned out to be a Best Western housed in a beautifully historical building. I assume it was actually once just the Hotel Kurfurst Wilhelm I?

DSC03007

It didn't have a railway view, but the station was right next door. We also didn't get much sunlight, but I managed to snap a military train the night we arrived!?

DSC03000

The next morning saw one freighter.. I got up and had breakfast as early as I could to then spend time down on the platform. The station is huge and has a tram interchange in the forecourt. The trams also take you right down into town. For some reason I didn't even take a photo of them!?

DSC03010

DSC03011 DSC03015 DSC03016

Leer

This was a very happy and random fluke. Turns out Leer (Ostfriesl) is on the mainline between a car plant and Emden Port and so there is a constant stream of traffic. Once again, we stayed in the hotel right next to the station, known as Hotel Frisia, which seemed to be very popular with the military.

DSC03147

The station itself probably has a lot of stories to tell. One of them might be that it's sick of looking at that weird yellow rocket on the round-a-bout out front.

DSC03146

So, where was I? Oh yes... the trains. As mentioned, there's a lot of freight traffic involving the transportation of new automobiles to the port in Emden. This comes from both directions, with the northbound trains turning on a siding just north of the station. You also get a lot of passenger trains. There's the Westfalen Bahn and the standard Deutsche Bahn. The former runs off to regional areas and the main company runs everything from long expresses to a Norddeich Mole which actually uses Leer as a turn-around station.

DSC03017 DSC03018 DSC03019

DSC03044 DSC03046 DSC03051

The Westfalen Bahn runs very regularly with 3-car EMUs. They're quite recent and in great condition. The colour scheme is also a nice change from the standard red of DB.

DSC03101

DSC03149 DSC03020 DSC03035

The Norddeich Mole runs from Norddeich via Emden through Leer to Hanover. It usually pulls into the third platform to keep the mainline free for all the other ICEs and freighters.

DSC03106 DSC03110 DSC03156

But then, sometimes another passenger train is on three and the Norddeich was on 2. Slightly confusing, but nobody seemed to miss their trains.

DSC03339 DSC03344 DSC03353

There's also an hourly ICE through to Stuttgart. But enough with the people carriers...

DSC03113 DSC03115 DSC03117

DSC03120

Turns out DB has their own Doctor Yellow and it, at this point in time, was diesel-powered and went for an excursion. It had actually been stored in a siding just north-west of the platforms.

DSC03053 DSC03060 DSC03066

DSC03063

From here, we'll talk freight. There were a lot of light engine moves and the drivers were in no mood to hang around. The engines happily went track-speed when they could. There were also a few loco shuffles.

DSC03141

Yeah... I know... you can hardly see there are two locos... you'll just have to trust me. Anyway, back to the actual freighters... from Platform one, if you look left (north), you'll see a branch that heads off right (east). the line heads off to Oldenburg and a lot of freight use Leer to get onto it.

DSC03086 DSC03089 DSC03092

DSC03096

For example, the above tanker consist had to snake its way across to the southbound rails, but proceeded south. The next snake didn't.

DSC03158 DSC03162 DSC03165

DSC03169

This train made it south of the station and into the yard. It then ran around and crossed back onto the northern line before continuing.

DSC03184 DSC03186 DSC03196

DSC03192

Finally, the fun part: the auto-carriers...

DSC03323 DSC03325 DSC03329

DSC03214 DSC03225 DSC03228

Both Volkswagen and Audi passed through the station... I still haven't quite worked out where their factories are. Numerous cargo companies were used to pull the services.

DSC03207

DSC03318

DSC03075

Meanwhile, the station has an amazing restaurant/cafe in it. Great pastries and breads... and coffee!

DSC03277

And here's a video of the view whilst I was sipping coffee.

And here's another freighter.

DSC03122 DSC03124 DSC03131

DSC03135

Oh! And a little diesel came through with parts of a wind turbine?

DSC03247 DSC03254 DSC03263

DSC03262

Finally... don't forget your snacks...

DSC03335

It's amazing seeing this much action in one place.

Filed under: INTL No Comments
28May/180

Visual Studio 2017: Error Deploying to Raspberry Pi 3

Any chance you've just opened up sample code to deploy an ARM-based project to a Raspberry Pi and you get this error?

DEP6100 : The following unexpected error occurred during bootstrapping stage 'Connecting to the device 'IP ADDRESS OF PI'.': 
MissingMethodException - 'Microsoft.Tools.Connectivity.RemoteDevice.Ping()'

Did you just install the Windows 10 SDK? My first recommendation is to reboot your machine! ...but actually, you don't really have to do that. Just restart visual studio. And yes, I know you closed it when you were installing the SDK... for some reason even opening it up straight after didn't work. A second restart of just VS2017 worked fine.

Also.. the default screen resolution is wrong on the PI when with a 7" 800x480 LCD. It really screws with the touch-screen input. Thanks to this article, we only have to do the following:

$username = "administrator"
$password = "[YOUR PASSWORD]"
$securePassword = ConvertTo-SecureString $password -AsPlainText -Force
$cred = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $username, $securePassword

$pstimeout = New-PSSessionoption -OperationTimeout (1000*60*5)
Enter-PSSession -computer [IP OF RASPBERRY PI 3] -Credential $cred -ErrorAction Stop -SessionOption $pstimeout

Save the above as a script and run it in the PowerShell ISE.

[IP IF MACHINE]: PS C:\> SetDisplayResolution.exe 800 480
Set Display Resolution and Orientation

replace line: gpu_mem=32                  # Set VC to 32MB, ARM DRAM to (1008-32)MB
append line: hdmi_mode=87
append line: hdmi_cvt=800 480 60 6 0 0 0
append line: lcd_rotate=0
Success! - You now need to reboot the device
use "shutdown -r -t 0"

Reboot!

25May/180

Germany, 2018 – Miniatur Wunderland

Miniatur Wunderland is nothing short of crazy. Two levels of HO scale model railroading at its finest. It's been around for over 10 years and has nearly seen the population of Australia in visitors! We were on a road-trip in a beautiful XF Jaguar (man, the Autobahns are fun) and I made sure we detoured via this monument.

DSC 0402 DSC 0403 DSC 0404

Miniatur Wunderland is located in Hamburg in a converted warehouse. Actually, they were still converting the warehouse (or the lower levels) when we were trying to enter and had to walk around a team angle-grinding the staircase... Regardless, we made it inside and even beat the queues. As we were leaving it turns out there was a wait to get inside!

DSC 0410

DSC 0411 DSC 0412 DSC 0414

The place is split up geographically, but all layouts are completely connected. It then turns where's-wally style with all sorts of trinkets to find. You also then get pushbuttons on the railings to activate random animations on the layout. In the last shot above, the conservatorium, which is a scale model of the actual building in Hamburg, splits open and the orchestra plays. It's pretty damn amazing!

DSC 0418 DSC 0420DSC 0426

Day and Night are modelled... snow as well! As you traverse the layout you end up going through America and all of the Europes... The model then gets two-level and you get a chance to watch trains tackle some serious terrain.

DSC 0437 DSC 0446 DSC 0449

There's even a train elevator working automatically behind the scenes!

DSC 0450 DSC 0451 DSC 0452

Of course, a lot of people come for the airport. The planes even take off and land! Also, keep your eyes open for whacky vehicles... which also take off and land... and even play appropriate theme songs when doing so!

DSC 0439 DSC 0440 DSC 0441

The control room is also crazy. There were at least 5 full-time staff watching cameras and reports. Some were even sending rescue locos in to bump trains.

DSC 0433

DSC 0455 DSC 0457 DSC 0458

DSC 0459

DSC 0461 DSC 0464 DSC 0465

DSC 0467 DSC 0468 DSC 0469

And finally... don't forget to shop and eat.

DSC 0470DSC 0471 DSC 0472

The cafe at the end is modelled as per the internals of a buffet carriage. All train nerds should visit this place!

Filed under: INTL No Comments
24May/180

Amsterdam, 2018 – Northern Metro Extension

With my brother living on the northern side of the Ij River, I was happy to see (via google maps) that there was a newly built station just near his house! Turns out that it's opening soon... and isn't actually ready for passengers. Regardless, they had constant EMUs in test, up and down the line seemingly running to the timetable.

This line will really help my family! I'm looking forward to riding it next time I'm in town... will also really help getting to the thrift stores in the south!

Filed under: INTL No Comments
23May/180

Amsterdam, 2018 – Amsterdam Centraal

This station looks nicer every time I visit it. Having my brother's bike available meant that I could go for leisurely cycles at-will, and most of those involved crossing the IJ on the free ferry and then hanging around Centraal watching traffic. One afternoon, towards the end of the trip, saw an hour spent on the platforms watching the comings and goings.

DSC03356

DSC03357 DSC03358 DSC03359 DSC03360DSC03362

DSC03364

DSC03365

DSC03366

I'm still a total fan of the Koplopers and was happy to see them still in service. It's been 7 years since I rode one and I've also passed on the HO Lima Model that I previously owned.

DSC03369

DSC03370 DSC03374 DSC03379 DSC03389 DSC03397

DSC03393 DSC03394 DSC03395

DSC03399

DSC03381 DSC03384 DSC03388

...That's enough photos... enjoy.

Filed under: INTL No Comments
22May/180

Amsterdam, 2018 – Thrift Shopping

Although the trip resembled a Chevy Chase movie, I still had Steven-time to jump on a bicycle and browse the used stores of Amsterdam. Timing for this trip was pretty good; Not only did I have "Europe's biggest flea market" on the weekend I landed, the weather was fantastic and the trip ended with King's Day.

IJ Hallen Market

Known as Europe's largest flea market, this event is held on the northern edge of the Ij River, just north of Amsterdam Centraal. A quick ferry will get you from the station to the market, but I rode there as my brother lives on the northern side of the river. This market was huuuuuuge and there was lots to be found. I must admit that there were very little electronics; but there were enough trains and vintage electronics to keep me entertained.

DSC 0259

DSC 0261 DSC 0262 DSC 0263

DSC 0266 DSC 0267 DSC 0268

Note that there're two trams and other random vehicles on site. There's also an airbnb in a crane, if you feel like staying really close. Actually, I think you can also stay in the trams!

DSC 0269 DSC 0272 DSC 0271

DSC 0324

DSC 0265 DSC 0318 DSC 0320

Van Dijk and Ko

On the way back from the market above, I stumbled across Van Dijk and Ko. It's an old warehouse full of trinkets! Aaaaand there's a cafe to have beer and bitterballen when (or before) you've done your shopping.

DSC 0280

DSC 0276 DSC 0284 DSC 0287

DSC 0290 DSC 0292 DSC 0293

Some pretty random electronics around! If I lived in Amsterdam then I'd be in these places way too often... the limitations of my suitcase really did prevent a lot of splurging!

The Second-Hand Shop Bicycle Tour

The thrift shopping was always going to be a priority in Amsterdam. It officially started in Buikslotermeerplein, a day before the trip below, as this was close to my accommodation. Point A on the map is north of Centraal and contains a store from the appropriately-named chain known as Used Products. They're pretty much the Cash Converters of Amsterdam; same products, same customers, same fights.

DSC 0301 DSC 0304 DSC 0305

The op-shop is called Kringloopbedrijf De Lokatie. I have no idea what this means? But it was very op-shop-esque with little IT. Lots of books and clothes. Still fun to look through.

DSC 0306 DSC 0307 DSC 0309

The next day, it was time to jump on the bicycle and target the city. This started with a ferry ride across the IJ, arriving under the bus interchange of Amsterdam Centraal Station. From there, it was a clockwise tour of the outer canal cycling from store to store.

Points B and C on the map were both Used Products stores. Both had interesting electronics and retro games, but nothing that really caught my eye.

DSC 0338

DSC 0339 DSC 0342 DSC 0340

DSC 0344

DSC 0345 DSC 0346 DSC 0347

I even ended up riding a fair way past the zoo and checked out a neat railway bridge in the process.

Waterlooplein Markets (Point D) (Note that it's Waterloo Plane, not Water-Loop-Line) is a daily flea market in the middle of town. I'd been numerous time before and didn't end up there on this trip. For those interested, it's an open market with lots of souvenirs. Also good if you need a phone charger or a bicycle repair!

DSC 0333

DSC 0328 DSC 0330 DSC 0332

Mevius (Point E) (that link is a little weird, might be the parent company) was the next stop. It's a huge shed right next to the old Tram Museum (which wasn't operational!) and is full of all sorts of stuff. I nearly picked up a Gravis Gamepad and ATI AGP Card... but for some reason chose not too. Maybe they were just too grotty.

DSC 0354

DSC 0348 DSC 0349 DSC 0350

DSC 0351 DSC 0352 DSC 0353

I then ended up at HobbyLand (Point F). I'd actually picked up an old Marklin steamer at the IJ Hallen markets and needed traction tyres. The sellers didn't speak English and asked if I knew Deutsch. Either way I managed to fake my way to describing a rubber tyre and purchased a size that worked!

DSC 0355 DSC 0356 DSC 0357

Just around the corner was Ari at Point G. And, it's nuts! You only need to read the articles here and here. This place is a thin corridor of a house with crap packed up all walls and ... well ... wherever else it will fit.

DSC 0358

DSC 0359 DSC 0361 DSC 0364

Point H was another Used Products store.

DSC 0366

DSC 0368 DSC 0369 DSC 0370

One must not forget a healthy lunch...

DSC 0371

Point I was also another Used Products store.

DSC 0375

DSC 0377 DSC 0378 DSC 0379

Rataplan is at point J on the map and seemed to be a large op-shop style store. It allowed people to drop stuff off as well. There weren't many electronics and mainly just dealt with homewares and old clothes.

DSC 0380 DSC 0381 DSC 0383

Across the road was Antiekbeurs "Amsterdam 700". This is denoted by K on the map, which is partially covered by I. This was a cool place dealing mainly with furniture; no electronics but still very cool to look through.

DSC 0388

DSC 0384 DSC 0385 DSC 0386

After being slightly disappointed by the first Rataplan, I wasn't expecting this second one at point L. It's freakin' huge and full of cool stuff! Lots of IT actually... interesting LCDs and other bits, but nothing that would fit in my suitcase!

DSC 0389

DSC 0390 DSC 0391 DSC 0392

How cute is that colour-coordination!?

DSC 0396 DSC 0394 DSC 0395

They even have an alterations service! Meanwhile... it's just huge... but I think I mentioned that already.

DSC 0397

Next up was an afternoon in Amsterdam Centraal watching Koplopers. My favourite way to spend an hour.

Filed under: INTL No Comments
10May/180

How to convert XML into a class the easy way!

An on-the-side project, that's been going for quite a while now, extracts data from a remote service. For a very long time, this was done via reverse-engineered Java code, of which I then wrapped my own console app around. All worked very well until they changed the login service request format and stopped using the Java altogether.

The new version was just HTML and json and, but the actual payload of the data I cared about was XML. Yes, that's right, XML in a string via JSON. Who would'da thunk? Regardless of the insanity, I was still itching to parse it.

So, the usual Json to C# class generator was used to build the de-serialisable class for the initial packet. I then needed a quick and smart way to convert the XML into a class.

Turns out that there is also an XML to C# converter! Paste in your XML blob and, if correctly formatted, it'll return a class that the XML can be de-serialised into!

And, it worked perfectly. Well, nearly. There was one gotcha! The XML class I was decoding had one field called Text. This is not a valid name inside a deserialised class in C#. So call it a different name in the class but override it via an attribute, as per below.

[XmlRoot(ElementName = "g", Namespace = "http://www.w3.org/2000/svg")]
public class G
{
        [XmlElement(ElementName = "rect", Namespace = "http://www.w3.org/2000/svg")]
        public List<rect> Rect { get; set; }
        [XmlElement(ElementName = "text", Namespace = "http://www.w3.org/2000/svg")]
        public List<textitem> Texts { get; set; }
        [XmlAttribute(AttributeName = "fill")]
        public string Fill { get; set; }
        [XmlAttribute(AttributeName = "stroke")]
        public string Stroke { get; set; }
        [XmlAttribute(AttributeName = "transform")]
        public string Transform { get; set; }
        [XmlAttribute(AttributeName = "text-anchor")]
        public string Textanchor { get; set; }
        [XmlElement(ElementName = "g", Namespace = "http://www.w3.org/2000/svg")]
        public G[] subG { get; set; }
}

Those watching trains on maps in Australia have the above site to thank for the speedy recovery of the service :)