Category Archives: Technology

[Solved]Get back Grub in Windows 8.1

I was using grub to dual boot my Lenovo Y410P with Windows 8 and Ubuntu 14.04.

Recently I finally decided to upgrade my Windows 8 to Windows 8.1 considering it should be pretty stable by now. However, to my horror(or rather not surprisingly), my default bootloader has been changed to Windows Bootloader which means I could not access my Ubuntu 14.04.

Usually this takes a while to fix, involving repairing grub/BCD and tend to be tedious. However, I managed to found a much simpler and direct solution to this.

With the new UEFI specification, we can actually choose the default boot manager instead of replacing one with another. All it takes is to go to UEFI Firmware settings and change the order of boot managers. Which means grub and Windows boot manager can co-exist somewhere in the hard disk and we can choose which one to use in the BIOS UEFI settings.

Accessing UEFI settings in Windows 8.1 is a bit different from what happens in Windows 8, you can follow these links:

http://www.thewindowsclub.com/access-uefi-firmware-settings-windows-8-1

http://acer-au.custhelp.com/app/answers/detail/a_id/32048/~/accessing-uefi-in-windows-8.1

The menu is something like this:

UEFI Settings

UEFI Settings

One you are in the UEFI boot priority settings, you can simply change the position of Ubuntu to the top so that grub will load when the PC is turned on:

UEFI Boot order priority setting

UEFI Boot order priority setting

(All photos taken by me)

 

 

Programming concepts in real life – Algorithm

This is the second post on the series of interesting thoughts of “programming concepts in real-life”. Today it occurred to me that one fundamental concept of programming – algorithm, is also heavily used in real life outside the IT world.

What is algorithm

Algorithm is a step-by-step procedure for calculations.

Algorithm used in programming

There are a lot of examples of algorithms in programming, the most basic ones include  breadth-first search (BFS) and  depth-first search (DFS).

Algorithm in real life

Algorithms are applied in our everyday life.

DFS/BFS (Depth-first-search/Breadth-first-search)

For example, for a freshman who just entered NUS, he may choose to study the area of his interest, such as marketing or psychology. He can do this in two ways, one is to really devote all the time and effort into this area and do nothing else for a very long time. So for marketing, he/she will be learning introductory modules on marketing, intermediate modules on marketing, advanced modules on marketing or even do a research on marketing. Only after he/she feels there is nothing else to do on marketing, then the person will consider other options. And surprisingly(or rather not surprisingly), this is exactly the concept of a particular algorithm called DFS. In DFS, you prioritize depth more than breadth, so when you have a chance to go wider or deeper, you will go deeper first.

And of course you can see how the opposite algorithm BFS works for real life. That is when a person takes all the introductory modules for different areas, however after all that still indecisive enough to make a decision for specialization. So he/she would take all the intermediate level modules for different areas and so on. This may work very badly for a freshman but the concept is similar to a liberal arts curriculum, where students are exposed to different disciplines for 1 or 2 years before they decide their major.

Amortized complexity optimization – CS3230 lecture on 13 Feb 2015

We use amortized complexity optimization in real life, for cleaning our rooms. Normally we do not clean our rooms every single day. We wait for the room to fall below a certain cleanliness standard or when there is an important visitor, then we start cleaning the room. Cleaning the room is an expensive operation which takes a lot of time. Hence, by doing it infrequently, only when absolutely necessary, we reduce the total amount of work needed to keep our room clean.

This idea is similar to amortized complexity optimization in algorithm analysis, where we optimize the average runtime to achieve better run time.

 

Other algorithms such as greedy algorithm and dynamic programming are also practised in real life(often without being realized).

 


More of this

The best Friday Hacks session so far

Today I attended the Friday Hacks(#68) by NUS Hackers as usual. I knew that the topic today is on NUSMods, a web app developed by a SoC senior – Beng, that is extremely popular and successful in NUS, and there will be a guest Jeff Moss who is a famous security expert. It turned out both talks were interesting and meaningful.

For the first part, Beng mainly talked about the history and design philosophy of the NUSMods. It was an inspiring story considering that he did this in year 2 and the web app went through a lot of changes before it finally become successful and popular among NUS students. In particular, the part on designing the app is interesting, he talked about “hackers who can design the app well enough is as rare as unicorn.” And I found this to be relevant. Sometimes the app may have the best functionality but the poor design may not attract the users or simply render the app unusable. Luckily, there are some books on design philosophies that are useful in designing apps. I figure that I should take a look at them when I have free time and before doing some serious web project. He also mentioned about the future of NUSMods which includes some APIs for new developers to use the data from NUSMods as well as using NUSMods’ existing popularity to transform it into a platform for displaying other apps relevant to NUS(taking the interpretation of NUSMods as NUS Modifications). These ideas may be relevant for me when I do my future projects.

The second part of the session was a short Q&A session for Jeff Moss and some of his colleagues. A lot of insightful questions ranging from personal security, NSA’s surveillance, issue of trust and prospect of computer security were asked and the reply given by the pros were very informative and insightful. We learnt about how strange phenomenons may be related to NSA’s surveillance programmes, the prospect of post Edward Snowden era for computer security. Some even drilled into the fundamental issue of the extent of trust we should give to others. A good point is that in IT industry, we have to ultimately give our trust to some strangers. It is not possible for us to build a functional computer, or in similar sense a full range of software. Hence, whatever we do, we need to trust the other people who developed the building blocks for the technology that we are using, be it the operating system or the processor.

On Google again, with DuckDuckGo

A few days ago I posted a blog about how important Google really is, as a search engine. Apparently I was not the first one to discover that Google is not that great after all.

It turns out that there is this search engine called DuckDuckGo that existed for several years. I read it on Hacker News and here is a link about it.

Basically, it offers instant answers to the queries instead of links to other websites, although the instant answers are from other websites. Google apparently has similar features now so that is not really the most important feature of the search engine.

This search engine put much more emphasis on user’s privacy. It does not track search records, or IP addresses, it also has no user account system. Hence, it became quite popular for privacy-conscious people.

Anyway, I learnt something today and hope it goes well for this DuckDuckGo. However, I prefer to stick to Google for the exact opposite reason: It has my data. I believe in the customized searching experience in Google based on my profile, although it often means I need to see ads that are “relevant” to me.