IDF2JSON

The last version eliminated all comments because they are not needed in the JSON format. But the comments can be used as properties. So, I did some modifications. Since I am not familiar with Fortran. All the work is done with Python by replacing characters to change the structure. The results are shown below:

{
    "_Version": "8.8",
    "_Timestep": "4",
    "_Building": {
        " Name": "Simple One Zone w Windows",
        " North Axis (deg)": "0",
        " Terrain": "Suburbs",
        " Loads Convergence Tolerance Value": "0.04",
        " Temperature Convergence Tolerance Value (deltaC)": "0.004",
        " Solar Distribution": "MinimalShadowing",
        " Maximum Number of Warmup Days": "30",
        " Minimum Number of Warmup Days": "6"
    },
    "_HeatBalanceAlgorithm": "ConductionTransferFunction",
    "_SurfaceConvectionAlgorithm___Inside": "TARP",
    "_SurfaceConvectionAlgorithm___Outside": "DOE-2",
    "_SimulationControl": {
        " Do Zone Sizing Calculation": "No",
        " Do System Sizing Calculation": "No",
        " Do Plant Sizing Calculation": "No",
        " Run Simulation for Sizing Periods": "Yes",
        " Run Simulation for Weather File Run Periods": "No"
    },
    "_RunPeriod": {
        " Name": "Null",
        " Begin Month": "1",
        " Begin Day of Month": "1",
        " End Month": "12",
        " End Day of Month": "31",
        " Day of Week for Start Day": "Tuesday",
        " Use Weather File Holidays and Special Days": "Yes",
        " Use Weather File Daylight Saving Period": "Yes",
        " Apply Weekend Holiday Rule": "No",
        " Use Weather File Rain Indicators": "Yes",
        " Use Weather File Snow Indicators": "Yes"
    },
    "_Site___Location": {
        " Name": "Denver Stapleton Intl Arpt CO USA WMO=724690",
        " Latitude (deg)": "39.77",
        " Longitude (deg)": "-104.87",
        " Time Zone (hr)": "-7.00",
        " Elevation (m)": "1611.00"
    },
    "_SizingPeriod___DesignDay": {
        " Name": "Denver Stapleton Intl Arpt Ann Clg 1% Condns DB=>MWB",
        " Month": "7",
        " Day of Month": "21",
        " Day Type": "SummerDesignDay",
        " Maximum Dry-Bulb Temperature (C)": "32.6",
        " Daily Dry-Bulb Temperature Range (deltaC)": "15.2",
        " Dry-Bulb Temperature Range Modifier Type": "Null",
        " Dry-Bulb Temperature Range Modifier Day Schedule Name": "Null",
        " Humidity Condition Type": "Wetbulb",
        " Wetbulb or DewPoint at Maximum Dry-Bulb (C)": "15.6",
        " Humidity Condition Day Schedule Name": "Null",
        " Humidity Ratio at Maximum Dry-Bulb (kgWater/kgDryAir)": "Null",
        " Enthalpy at Maximum Dry-Bulb (J/kg)": "Null",
        " Daily Wet-Bulb Temperature Range (deltaC)": "Null",
        " Barometric Pressure (Pa)": "83411.",
        " Wind Speed (m/s)": "4",
        " Wind Direction (deg)": "120",
        " Rain Indicator": "No",
        " Snow Indicator": "No",
        " Daylight Saving Time Indicator": "No",
        " Solar Model Indicator": "ASHRAEClearSky",
        " Beam Solar Day Schedule Name": "Null",
        " Diffuse Solar Day Schedule Name": "Null",
        " ASHRAE Clear Sky Optical Depth for Beam Irradiance (taub) (dimensionless)": "Null",
        " ASHRAE Clear Sky Optical Depth for Diffuse Irradiance (taud) (dimensionless)": "Null",
        " Sky Clearness": "1.00"
    },
    "_Material___NoMass": {
        " Name": "R31LAYER",
        " Roughness": "Rough",
        " Thermal Resistance (m2-K/W)": "5.456",
        " Thermal Absorptance": "0.9000000",
        " Solar Absorptance": "0.7500000",
        " Visible Absorptance": "0.7500000"
    },
    "_Material": {
        " Name": "C5 - 4 IN HW CONCRETE",
        " Roughness": "MediumRough",
        " Thickness (m)": "0.1014984",
        " Conductivity (W/m-K)": "1.729577",
        " Density (kg/m3)": "2242.585",
        " Specific Heat (J/kg-K)": "836.8000",
        " Thermal Absorptance": "0.9000000",
        " Solar Absorptance": "0.6500000",
        " Visible Absorptance": "0.6500000"
    },
    "_Construction": {
        " Name": "ROOF31",
        " Outside Layer": "R31LAYER"
    },
    "_Construction___WindowDataFile": {
        " Name": "DoubleClear",
        " File Name": "..BACKSLASHdatasetsBACKSLASHWindow5DataFile.dat"
    },
    "_Site___GroundTemperature___BuildingSurface": "18.89,18.92,19.02,19.12,19.21,19.23,19.07,19.32,19.09,19.21,19.13,18.96",
    "_Zone": {
        " Name": "ZONE ONE",
        " Direction of Relative North (deg)": "0",
        " X Origin (m)": "0",
        " Y Origin (m)": "0",
        " Z Origin (m)": "0",
        " Type": "1",
        " Multiplier": "1",
        " Ceiling Height (m)": "autocalculate",
        " Volume (m3)": "autocalculate"
    },
    "_ScheduleTypeLimits": {
        " Name": "Fraction",
        " Lower Limit Value": "0.0",
        " Upper Limit Value": "1.0",
        " Numeric Type": "CONTINUOUS"
    },
    "_GlobalGeometryRules": {
        " Starting Vertex Position": "UpperLeftCorner",
        " Vertex Entry Direction": "CounterClockWise",
        " Coordinate System": "World"
    },
    "_BuildingSurface___Detailed": {
        " Name": "Zn001___Roof001",
        " Surface Type": "Roof",
        " Construction Name": "ROOF31",
        " Zone Name": "ZONE ONE",
        " Outside Boundary Condition": "Outdoors",
        " Outside Boundary Condition Object": "Null",
        " Sun Exposure": "SunExposed",
        " Wind Exposure": "WindExposed",
        " View Factor to Ground": "0",
        " Number of Vertices": "4",
        " X,Y,Z ==> Vertex 1 (m)": "0.000000,15.24000,4.572",
        " X,Y,Z ==> Vertex 2 (m)": "0.000000,0.000000,4.572",
        " X,Y,Z ==> Vertex 3 (m)": "15.24000,0.000000,4.572",
        " X,Y,Z ==> Vertex 4 (m)": "15.24000,15.24000,4.572"
    },
    "_FenestrationSurface___Detailed": {
        " Name": "Zn001_Wall001_Win001",
        " Surface Type": "Window",
        " Construction Name": "DoubleClear",
        " Building Surface Name": "Zn001___Wall001",
        " Outside Boundary Condition Object": "Null",
        " View Factor to Ground": "0.5000000",
        " Shading Control Name": "Null",
        " Frame and Divider Name": "Null",
        " Multiplier": "1.0",
        " Number of Vertices": "4",
        " X,Y,Z ==> Vertex 1 (m)": "0.548000,0,2.5000",
        " X,Y,Z ==> Vertex 2 (m)": "0.548000,0,0.5000",
        " X,Y,Z ==> Vertex 3 (m)": "5.548000,0,0.5000",
        " X,Y,Z ==> Vertex 4 (m)": "5.548000,0,2.5000"
    },
    "_Output___Variable": "ZN001___WALL001___WIN001,Surface Outside Face Temperature,timestep",
    "_Output___VariableDictionary": "Regular",
    "_Output___Surfaces___Drawing": "dxf",
    "_Output___Surfaces___List": "details",
    "_Output___Constructions": "Constructions",
    "_Output___Meter___MeterFileOnly": "EnergyTransfer___Facility,hourly",
    "_OutputControl___Table___Style": {
        " Column Separator": "HTML"
    },
    "_Output___Table___SummaryReports": {
        " Report 1 Name": "AllSummary"
    }
}

JSON implementation for EnergyPlus IDF

EnergyPlus is developed based on Fortran 950. The file format looks very like JavaScript Object Notation (JSON). By extracting the comments as properties, it can be transformed to JSON format. I did some modifications to EnergyPlus IDF file and transformed it to JSON format with Python. The JSON file was validated by https://www.bejson.com/. Then, I transformed it back to IDF and ran the simulation again. An example file is shown below.

{
"Version": "8.8",
"Timestep": "4",
"Building": "___Simple One Zone w Windows,___0,___Suburbs,___0.04,___0.004,___MinimalShadowing,___30,___6",
"HeatBalanceAlgorithm": "ConductionTransferFunction",
"SurfaceConvectionAlgorithm___Inside": "TARP",
"SurfaceConvectionAlgorithm___Outside": "DOE-2",
"SimulationControl": "___No,___No,___No,___Yes,___No",
"RunPeriod": "___Null,___1,___1,___12,___31,___Tuesday,___Yes,___Yes,___No,___Yes,___Yes",
"Site___Location": "___Denver Stapleton Intl Arpt CO USA WMO=724690,___39.77,___-104.87,___-7.00,___1611.00",
"SizingPeriod___DesignDay": "___Denver Stapleton Intl Arpt Ann Clg 1% Condns DB=>MWB,___7,___21,___SummerDesignDay,___32.6,___15.2,___Null,___Null,___Wetbulb,___15.6,___Null,___Null,___Null,___Null,___83411.,___4,___120,___No,___No,___No,___ASHRAEClearSky,___Null,___Null,___Null,___Null,___1.00",
"Material___NoMass": "___R31LAYER,___Rough,___5.456,___0.9000000,___0.7500000,___0.7500000",
"Material": "___C5 - 4 IN HW CONCRETE,___MediumRough,___0.1014984,___1.729577,___2242.585,___836.8000,___0.9000000,___0.6500000,___0.6500000",
"Construction": "___ROOF31,___R31LAYER",
"Construction___WindowDataFile": "___DoubleClear,___..BACKSLASHdatasetsBACKSLASHWindow5DataFile.dat",
"Site___GroundTemperature___BuildingSurface": "18.89,18.92,19.02,19.12,19.21,19.23,19.07,19.32,19.09,19.21,19.13,18.96",
"Zone": "___ZONE ONE,___0,___0,___0,___0,___1,___1,___autocalculate,___autocalculate",
"ScheduleTypeLimits": "___Fraction,___0.0,___1.0,___CONTINUOUS",
"GlobalGeometryRules": "___UpperLeftCorner,___CounterClockWise,___World",
"BuildingSurface___Detailed": "___Zn001___Roof001,___Roof,___ROOF31,___ZONE ONE,___Outdoors,___Null,___SunExposed,___WindExposed,___0,___4,___0.000000,15.24000,4.572,___0.000000,0.000000,4.572,___15.24000,0.000000,4.572,___15.24000,15.24000,4.572",
"FenestrationSurface___Detailed": "___Zn001___Wall001___Win001,___Window,___DoubleClear,___Zn001___Wall001,___Null,___0.5000000,___Null,___Null,___1.0,___4,___0.548000,0,2.5000,___0.548000,0,0.5000,___5.548000,0,0.5000,___5.548000,0,2.5000",
"Output___Variable": "ZN001___WALL001___WIN001,Surface Outside Face Temperature,timestep",
"Output___VariableDictionary": "Regular",
"Output___Surfaces___Drawing": "dxf",
"Output___Surfaces___List": "details",
"Output___Constructions": "Constructions",
"Output___Meter___MeterFileOnly": "EnergyTransfer___Facility,hourly",
"OutputControl___Table___Style": "___HTML",
"Output___Table___SummaryReports": "___AllSummary"
}

Error establishing a database connection

After upgrading to Version 4.9. I got an error of Error establishing a database connection. The possible cause of ‘Error establishing a database connection’ is the problems in MySQL, check the username and password in wp-config.php. But the causes may vary.
Firstly, open ‘wp-config.php’ and set ‘define(‘WP_DEBUG’, ‘true’)’;
Then, go to the website to see the possible problems. In my case, the website indicated two errors, problems with my MySQL account and a warning: mysql_connect(): Headers and client library minor version mismatch.
I used this command ‘php -i|grep Client’ to check the possible cause of the warning. Turned out it was the version of MySQL being too old.
So, I changed the MySQL account settings in the wp-config file. Then, reinstalled MySQL to its newest version and restarted services with following lines:

yum remove php-MySQL
yum install php-mysqlnd
systemctl restart httpd
systemctl restart mysqld

Thanks to:
http://blog.csdn.net/ausboyue/article/details/52790222
https://devework.com/debugging-in-wordpress.html

Visualize Famous Campus in China

In the end of the 9th month of 2017, I wrote several lines to visualize the site with maps. Visualizations of famous campus surroundings are presented. The codes will be available on GitHub. Now I just show some results within a 1000 m circle centered by the Department of Civil Engineering.

First the campus of HNU, the points are quite abstract. But for anyone who has lived there, the basic layout has been clearly drawn. Obviously, the campus area of HNU is quite small.

 
Campus of Hunan University

 

However, its neighbor, Central South University, has a better site. The effective area for constructions is much bigger. And that is merely a small part of its 3.86 million square meters (at least three times the size of HNU). To be honest, I first heard the name Central South University was in April 2017, before then, I had no idea the location of this facility. And now, wow, it’s really a large site.

 
Campus of Central South University

Anyway, let’s take a look at other famous universities. Tongji University as the best civil engineering institute has fully developed its site. The surroundings have covered the circle.

 
Campus of Tongji University

As for Tsinghua University and Beijing University the two legendary institutes, Beijing University has a similar distribution to Tongji University. The campus of Tsinghua University has a clear distribution along the street network.

 
Campus of Tsinghua University
 
Campus of Beijing University

But the best site planning belongs to Zhejiang University. A clear street network, the dense buildings with enough openings, this campus must be very beautiful.

 
Campus of Zhejiang University

 

Solution to Anaconda Failed to Create Menus

This time I tried to solve a problem while installing Anaconda. My friend, a charming and talented lady, is interested in computer science. She wanted to learn python. So, I recommended Anaconda to her. It never occurred to me that there could be problems installing it. The failure is that ‘Anaconda failed to create menus.’

Answers from Github indicate there are many reasons, and the problem might be solved in the coming releases. They also presented many possible solutions. But most of them didn’t work. After trying again and again, I had to copy the complete folders to her installation and execute the following lines:

Firstly, go the Anaconda/Script, input ‘conda update conda’,

Then, go to Anacnoda/Lib, input ‘..python _nsis.py mkmenus’,

And problem solved.

Thanks to https://stackoverflow.com/questions/34780267/anaconda-python-installation-error.

Manually Update WordPress

The website reminded me about a new version had been launched. So I clicked Update. I expected it to finish updating quickly. And it did, with an error of unable to write folders. Initially, I thought it should be the problem of ‘Group’. I added a new group, changed the permissions and assigned the files to the group. No use. Then, I changed the files to 777, yet it did not work, either.

I decided to update it manually. The following two methods are tested. The first method was to download and upload the latest version through SSH, which was too slow, not to mention the network. All these led to the second method of the following lines:

wget http://wordpress.org/latest.zip

unzip latest.zip

rm –rf wordpress/wp-content /var/www/html/wp-admin /var/www/html/wp-includes

mv wordpress/* /varwww/html/

rm –rf wordpress

Remember, before the commands executed, the important files are backed up.

Updated 23/01/2018:

chmod 777 wp-content and upload a file, then check its properties.

In my case, it’s apache.

chmod 755 wp-content

chown -R apache:apache html

(From, http://blog.csdn.net/robertsong2004/article/details/50465034)