Wednesday, February 22, 2017

Excel 2016 64 bits - Slow marco




I have been suffering from "upgrading" Excel 2013 bits to Excel 2016 64 bits. There are some excel marco becoming painfully slow, says 8 -10 times slower, in Excel 2016 64 bits, compare with Excel 32 bits.

Microsoft tells me Excel 64 bits is a lot better than Excel 32 bits, in term of file size limit, memory management.... blah..blah...blah... In fact,  I don't see any so called "improvement" for a product developed almost 30 years ago. People are asking for a productive tool to get their job done and go back home on time. You cannot expect every car owner knows how a car works and able to fix it.

After pulling my hair off for days, I find that there are things have to be disabled before running a sizable marco for the "best performance". The reasons behind is something actually does not matter to people life. *Though... can be easily found on Google, some of them are just ridiculous.

Application.EnableEvents = False
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Application.PrintCommunication = False
Application.EnableAutoComplete = False
Application.EnableLivePreview = False
Application.Cursor = xlWait             'When the mouse cursor pointed on a cell, the excel slows down


I am now going back home.

Sunday, February 5, 2017

SNES9X - Synchronize save state between Android and PC



Snes9X is one of the best Android SNES emulators ever made. It is free, no ads, highly customisable. It helps bringing back tons of good memories. The auto save in Android version is just making the emulator even better than the original snes.

Snes9X
Android: https://play.google.com/store/apps/details?id=com.explusalpha.Snes9xPlus&hl=en 
Windows: http://www.snes9x.com/

I wanted to play SNES on my PC at home and on my Android on the go. SNES9x EX no doubt deserves a 5 stars, but so far it does not support cloud save.

It is non-sense to play Chrono Trigger with a 5.5 inch phone screen at home. So I decided to hands on a bit. It took me some time to Google to find the way out. The investment is well paid-off.

The thing is going to be a bit techie, so grab a coffee if necessary.

Finding save files

By default, the save file is located same as the ROM folder in Android; and save file is located in the "Saves" folder in the SNES folder in Windows.

Windows > Emulation > Settings


The Android save files ends with an extension .0A.frz ~ .0J.frz and the Windows save file ends with an extension .000 ~ .009

Converting save files

The Windows save file and the Android save file are actually the same. The only difference is their filename extension. They can be converted simply by changing the filename extension.

i.e.

Windows
Chrono Trigger.000

Android
Chrono Trigger.0A.frz


Copy all the save files from Android to Windows. Find the newest save files by comparing their timestamp. Change the extension from .000 to .0A.frz or vice versa

I created a VB script to get rid of this repetitive boring job.


Save file converter: https://github.com/DavidTsangHW/SNES9X-save-file-converter 

Cloud storage

It is not cool keep copying those save files between my PC and my phone. I wanted a more sophisticated way of doing this. I need a cloud storage. There are free cloud storage i.e. One Drive, Google Drive and Dropbox to choose from, but only the official Dropbox Android client allows exporting files to a custom location (SNES saves folder). Dropbox is the best pick for this.

Download: https://www.dropbox.com/

Setup Dropbox Windows Client

After installing Dropbox client on Windows, move the Save folder in the Dropbox folder. All new saves will be saved to Dropbox automatically as well.

Install DropSync Android Client

The official Dropbox Android client allows you to upload and download save files from the cloud storage. Yet, this can only be done, each time, manually.


To skip this painful and meaningless task, there is a better deal. Dropsync is  a Android Dropbox Client which  synchronizes files between you phone and the cloud storage periodically (say 5, 10, 30 minutes). The free version supports only one folder synchronization only, but it is sufficient to get the job done.

Choose the save folder for the periodic synchronization. DropSync will upload and download the latest game saves to the cloud storage.

Voila!

Applying SMA10/20, SMA20/50 as trading signals

This is the comparison for results before and after applying SMA10/20 and SMA20/50 in the stock trader. Background Trading 3 stock ma...