Tag Archives: tutorials

Customizing the editor for coding

A lot of people hate software just because they do not like the look and feel of the user interface. Surprisingly even the knowledgeable “geeks” have strong preferences on the GUI (Graphical User Interface). This often takes away the focus from functionality and versatility of programs and impact negatively on high quality products.

The good news is that most programs have customizing options available for both GUIs and back-end. However, very few users are aware of these hidden gems. In this article we will discuss the customizability of the open source free software Notepad++ (“Notepad Plus Plus”).

Notepad++

Notepad++ is highly customizable and flexible enough to work with almost all programming languages. As soon as you save your file as a .php, .html, .py, .cpp, etc it will pick up all the standard syntax related to each language. In addition you can use this program as a standard text editor.

The initial setup is simple. Download the program from here and follow the on screen instructions.

Select "Themes" during install.
Select Themes during install.
Make sure you select themes (check mark it). If you do not have much experience with the program, I would recommend you select exactly what I have above. I do not have an image of the next window, but if you are unsure, do not select anything on the next window. Just move on as next, next, etc.

Once the installation is completed, go to settings on the top ribbon. Open Style Configurator…

Settings drop down menu.
Settings drop down menu.

In the Style Configurator window you have variety of options. You can have fun with this, but for now, I would select a per-configured set from Select theme drop down.

Styles selection drop down list.
Styles selection drop down list.
Personally I like black background because I find it better on my eyes. I spend hours at a time writing code and most people I talked to also found back background to be very pleasant (as opposed to white).
PHP syntax coloured (automatic) on black background.
PHP syntax coloured (automatic) on black background.
It is my personal preference. The beauty of customization is you can choose a theme and/or color scheme to get your ideal working environment. Since you can always reset these, I entourage you to experiment with it.

HTML-Kit (free version)

Don’t get fooled by the name! This is one of the best free code editors out there. It started as a basic HTML editor and then transformed into what it is today. Like Notepad++, it also have support for almost all languages. However, this is big HOWEVER, it is not open source nor it comes with all the customization features like Notepad++. You cannot change the themes without having to buy their “premium” version. While I have used this extensively in the past, I am tired of limitations in free version. Please try Notepad++ first and if you don’t find it useful, the second best option would be HTML-Kit free version. Why pay for features that already included in FREE Notepad++?

Other Editors

All general text editing software that allow saving files in different formats (.php, .html, etc) can be used for programming. If you are new to coding please find a software that have built in syntax highlighter (eliminate Microsoft Notepad). This will make those first few steps into coding fun.

Mobile friendly websites

The file sizes associated with web pages have increased as designs get more complex and rich in media. As expected network speeds have also increased to accommodate the growing bandwidth demand. When it comes to mobile Internet, it is lagging bit behind the conventional Internet. The download speed of a average Canadian household is about 85 Mbit/s in the top tier plans as of 2013, while the average speed of mobile Internet not even 1/3 of it. The gap is so big, it impacts negatively on the performance of general websites. This is why even media companies like CNN, BBC and CBC have developed mobile versions of their web content in addition to media rich desktop version.

The mobile Internet is growing at a rapid rate in almost every country on Earth. Hence, the demand for mobile friendly fast loading websites are growing and so are the tools to combat it. I will introduce you to those tools and their advantages and disadvantages.

Mobile friendly right out of the box

I can categorically argue that almost every single non-graphic/media oriented website in 1980s and 1990s were 100 % mobile friendly. Even the most early version of the Internet called bulletin board system probably more mobile friendly than the desktop version of this site. Today visitors are not only attracted to functionality but also the visual appeal.

There are several way to balance between the visual appeal and mobile functionality. The concept of responsive themes are not a new one because it is similar to those 1980s sites. What sets it apart now is that modern responsive themes do not compromise graphical elements. If you are using CMS (Content Management System) programs, then you can load a theme with responsive support. When someone enter the site on a mobile device or on a smaller resolution device, the theme width and dimensions of elements will change accordingly. This is a right out of the box type solution, in which web editors do not have to depend on outside applications or scripts for mobile version of the site. Obviously it is better than an independent mobile site like in the old days. When you have independent sites, you have to edit two different files when publishing a single post. Another advantage is if you do not have a CMS program, you could still use responsive themes to automate using CSS and other scripts. It is not that hard to implement a responsive theme on a HTML site.

But it is not the silver bullet either. One of the major faults in responsive themes is that if a visitor decide to re-size their window on a desktop, it will response to the change as well. Not only that, on mobile devices you lose the ability to just switch to full desktop mode. Because we have large screen devices like tablets and SG Note II/III, I find some responsive themes can be annoying to use.

Make it mobile

gmneoBy using a separate set of conditions for mobile users, you can create a mobile version of the same content with different a mobile friendly outline. In order to do this, you will install two different themes. A mobile detection script will pick up on visitor using mobile devices and automatically direct them to the mobile version of the site. If they wish, you can still provide an option for the user to switch back to the desktop version. If you are using a CMS, there are many plugins and extensions for both Drupal and WordPress. One of my favorite is Graphene Mobile Neo. I recommend using a mobile theme from the same developers who created your desktop theme to avoid any script conflicts and to retain all the short codes in the mobile version. Hence if you are using the Graphene Desktop version, please consider buying the their Mobile Neo version. A lot of people don’t know that Graphene WordPress theme is highly customizable and can be use even on large scale corporate environments. You can also use either versions of the Graphene theme as a stand along (without the need to have one version to support the other).

Unfortunately I have already purchased a mobile friendly theme for this site from another developer. It is actually far more expensive than Mobile Neo. It does not support any third party short codes without major modifications to the code. It is called WPtouch. I don’t say that their version is bad, but they do charge an arm and a leg for not only for initial purchase, but also for higher upgrade versions. They probably have the most popular mobile plugin in the WordPress market. I do not recommend them because I don’t think the theme worth $59 Canadian.

I have to be honest that I am bias towards mobile themes (as opposed to responsive themes). I don’t exactly remember where I read them, but several research groups have studied the load time and resource usage by a responsive and mobile themes. The conclusions of these studies are about 50/50 in support of mobile themes. I personally noticed that having a mobile theme and/or an independent mobile version to be more useful. The biggest advantage is that since you have two independent set of options for each version, you have full control over both versions. In addition, users now have the option to switch between the versions when using mobile devices. I publish a lot of Geology and Programming related articles here. One of the responsive themes I tried pushed some of my content to a side when viewing on a mobile window. It makes it harder to read and sometimes even useless all together. While I am sure someone will come up with a way to switch off responsiveness of a responsive theme (what a crap load of words, lol), I still prefer the customizations of mobile themes. You can also reduce the server load by preventing scripts specifically used on desktop, when someone use your mobile site. Another thing I did with mobile theme is to replace a code in mobile version to optimize usability. For example, let’s say you have a photo gallery. Each photo is open on a pop-up “lightbox” on desktop. If you have the same operation, but now on a very small screen, the pop up will most likely will either go off screen or will be too small to view. You could replace the code specifically in the mobile side to avoid such issues.

Problems with browsers

A major problem with browsers is that there are too many. Look at IE (Internet Explorer) disaster. I hate writing code just to make IE users happy. Depending on the mobile browsers your visitors use, your site will be displayed either right or wrong. Nope, I never seen half-right rendering. Specially if you are running a business, you need to have the online publications as smooth as possible. Even I found myself switching to desktop version of my own site because some of my images are improperly rendered in the mobile theme. This another reason why I support mobile theme with a desktop switch option!

Conclusion

At the end it is your choice! Some of you will disagree with my experience with WordPress mobilization methods. As long as you can keep your mobile visitors (customers) happy, that’s what counts. When designing and coding websites, keep in mind that most people are not as tech savvy as you are. Do not expect your visitors to spend time figuring out how to make their experience pleasurable. It is your responsibility to provide support for the site.

How to read Geological Maps

For someone who is new to Geology, reading highly technical maps could be a challenge. I remember even I had trouble reading data off of maps when I was in first year Geology class. It is nothing to be shamed of because I know even the most seasoned Geologists who read their maps wrong. But the difference between a skilled Geologist and a lay person is that a Geologist would be able to find his/her own mistake. This article will introduce you to the most fundamental aspects of Geologic maps.

Direction

True North Indicator.
True North Indicator.
Most maps are published with respect to true North. When working in the field, the compass will read the magnetic North. To correct this error, you should find the magnetic declination for the region either using the provided data on the side of the map or by extracting the information from services such as USGS official website. To take measurements off of a map, use a navigational protractor to find the angle between the feature and the North (angles are always measured clockwise). In the field, bearing of a feature is always read from the North and should be redecorated with not just the angle, but also the location, date and time. Make sure that you have adjusted your compass declination arm with the correct angle of declination before taking any measurements.

Scale and Contour Interval

Depending on the type of map, the scale may be given in several different units. This is because of the conventions we use today have been evolved slowly depending on the task. For example, most Geological maps will include a feet scale along with miles or kilometers. This will avoid the issue of having elevation and structural contours (which usually given in feet) in one unit and the map scale in another.

Scale in miles an km
Scale in miles an km

There are maps that use only one type of measurements. However, rarely you would come across a map that uses meters for contour over feet. While it does not matter which type you use, I recommend using feet since it will reduce the conversion errors in the long run.
A Geological map with contour lines.
A Geological map with contour lines.

Contour lines are always changes at a set interval, but not with a set distance.

Formations and Features

Finally, recognize the different formations and use the contacts between them to calculate strike and dip. (The key for the colour coding should be printed on the map itself.) It is a common practice to use a Navigational Protractor for measurements. If you have to draw structure contours, use two triangles to move from one line to the next. This will keep all your lines parallel to each other.

Navigational Protractor
Navigational Protractor

Some maps are published with specific information on Geology. This type of maps are based on extensive research than general geological maps. For example, a structural map of a small area could contain several faults and complex mountains. While these features will also show up on a regular geologic map, structural Geologist may find it difficult to work without having the access to specific details.

A repeated GPS based map of Aegean region between 1993 and 1998.
A repeated GPS based map of Aegean region between 1993 and 1998. The symbols are used to indicate the rotational motion of blocks.(1)

Symbols and Conventions

You may be surprised to hear that Scientists have not come to a complete agreement on what symbols we should use for what purpose. We have been using so many different symbols or variations of symbols, that sometimes reading data could be difficult. My approach to this problem is to first read all the available data on the map itself. Date of publish, the publisher, the year of publish and the location often contributes to how it is printed. For example, the following two figures shows few variations in symbols for folds.

Some of the common symbols used for folds.
Some of the common symbols used for folds(2)
Fold block separation symbols.
Fold block separation symbols(2)

Tips

The geometry of the elevation changes are often complicated, thus the patterns such as space between contour lines and their shapes can be used to identify key features. For example, the rule of V states, if several lines are pointing to one direction in the shape of a “V”, then it is most likely a valley or a fold. If it is a valley, the dip is in opposite to the point on the V. In other words, upstream is in the direction of the tip of the V.

Learn more

USGS – How to use a Compass

References

1. Earth and Planetary Sciences Letters, v.172, Cocard, M. andothers, Newcon-strain tsonthe rapid crustal motion of the Aegean region: recent results inferred from GPS measurements(19931998) across the West Hellenic Arc, Greece, p.3947

Excel Visual Basic Scripts

A simple program like Microsoft Excel 2010 can be used as a powerful tool by manipulating the software. Microsoft has published several “how to” guides such as this one Getting Started with VBA in Excel 2010. They are very good articles, and I am not trying to beat them. After all, they wrote the software anyway. I just want to introduce Excel as a powerful programing tool for home users Continue reading Excel Visual Basic Scripts

Multiple Google accounts on Android Gmail

There are two independent email applications (apps) per-loaded by Google Inc. on Android devices running 4.0.x to 4.2.x (may be even before 4.0); Gmail and Email. The Gmail app is used for Google push service while the other is for non-Google email accounts. During initial setup of the phone, the user will prompt to add a Continue reading Multiple Google accounts on Android Gmail