Sylvester–Gallai theorem – the intuitive proof

This article presents an effort to use Induction in geometry to prove Sylvester Gallois Theorum.

Theorem statement can be viewed here

For the proof, let us rephrase the theorem as follows –
(1) Given a finite set of points in Euclidian space such that any line passing through two of the points passes through at least one more of them, all points have to be collinear.

Proof
Let n be the finite number of points in the given set.

Base case:
Let n=3,
Given 3 points, such that a line containing two of them passes through one more of them, they are by definition, collinear.
Thus (1) is true for n=3.
Induction step
P(k) :
Let (1) be true for a given k points set. So in the given k-point set in space, all the points are collinear.

P(k+1):
For an external point in the same space to pass through any line passing through two of the points in the k-points set in P(k), it has to pass through the line passing through all of them.
Thus the only way to expand the given set of k points to a set of k+1 number of points, is to include an external point which is collinear with the existing points.
Hence all k+1 points of the expanded set are collinear.

Thus if (1) is true for n=k, then it is true for n=k+1

Thus by principle of induction, (1) is true for all n>=3.

Bring Tab bar to top of terminal in Konsole

Tab selector (tab bar) can be made to appear on the top side of terminal in Konsole  as follows -

  1. Menu Bar => Settings => Configure Konsole
  2. Select TabBar pane
  3. Set “Tab bar position” to “Above Terminal Area”

As you might have noticed now, you can make Konsole open new tabs adjacent to current tab by setting “New tab behavior” to “Put New Tab After current tab”

How to remove URL forwarding to Yahoo Search by or through Search.Conduit

Problem: The URLs including development/local ones are forwarded to Yahoo Search page by a Conduit plugin via their search.conduit portal (as seen from status bar message)

Reason: Spyware by Conduit (Anything that changes the settings of your computer without explicitly asking you, and sends out information from your computer without letting you know – is a spyware/malware indeed)

Fix: Available here : “http://www.techsupportall.com/how-to-remove-conduit-search/” (Download and run Adware-Removal-Tool-v3.8.exe from there. Verified working.)

AppFuse jetty:run throws error “ZipException: invalid distance too far back”

Problem: When running mvn jetty:run to launch jetty, Appfuse throws error “java.util.zip.ZipException: invalid distance too far back”

Reason: One of the jars in maven repository is corrupted.

Fix: (Kind of nuke all, but works)

  1. Delete repository folder from .m2 folder : rm -r ~/.m2/repository
  2. Add any local jars you may have added to repository
  3. From AppFuse project folder, run : mvn:jetty-run

OR,

  1. Find the offending jar from the exception stacktrace.
  2. Delete the folder containing the jar inside ~/.m2/repository
  3. Run “mvn install” or mvn:jetty-run.

Solved: Spring util:map, the Keys are not correct / as expected

Problem : The map instance created using util:map does not give expected keys in Java class when obtained using autowiring.

Reason: When autowired, spring searches for the first Map with same name, and the result might not be the Map configured by the developer in the context xml.

Fix: Instead the tag @Autowired, use  @Resource(name=”mapName”) for the map instance in the caller class.

Publishing your Android Application

All done and dusted, when you are ready to upload your application to the Android Market for the world to use it, you’ll have to follow a few steps below.

  • Remember to change the AndroidManifest.xml file to the specifics such as min SDK version etc.
  • In your manifest file, switch to the manifest tab. In the Exporting section is an option Use the Export Wizard to export and sign an apk.
  • Select the Project that you want to export and click Next.
  • Now for the Keystore selection, this provides a certificate to you application. Since you do not have a keystore yet, click on Create New Keystore. Remember to save this certificate in a safe location and not lose it. If you decide to update your application in the future, you’re going to need the same certificate. If you somehow happen to lose this certificate, you’re going to have to upload a whole new application again.
  • Select the location and provide and confirm a password.
  • In the Key Creation section provide an Alias so as to refer to the key being created.
  • Provide a password. For validity in years put in 25.
  • Fill in your First and Last Name. You can also go ahead and provide the other details if you want.
  • In the next step, browse and select a location for you final apk file.
  • When you look for an application on the Android Market, you must have seen a lot of pictures and graphics on the application page. You can choose to create those graphics for your application too. I’m going to skip this step.
  • Now got to http://market.android.com/publish.
  • Click on Upload Application towards the bottom. Follow the on-screen instructions and upload the apk and other necessary graphics.

You’re done!! Your application is up and running on the Market!!

6 Websites Android Developers Must Know

Creating an Android Application that users can both use and appreciate is not an easy task. However, obviously some online resources can make your life easier. I present below 6 websites that are a “must know” for all Android Developers.

  • The Android Developer Official Page
    androiddeveloperObviously, this website contains answers to all questions that an Android Developer can possibly have. The Official Documentation is just too good and sufficiently comprehensive for newbies. Visit Android Developer Website.
  • MIT App Inventor
    mitappinventor
    Probably, the best website after the Official Android Developer website for learning and teaching Android Development. I suggest all of you do take a look at it. Visit MIT App Inventor.
  • Color Combos
    colorcombos
    Obviously in your application you will need to choose colors. Color Combos helps you do this in a jiffy. Visit Color Combos.
  • Icon Finder
    iconfinder
    Fancy icons add a new dimensions to the looks of an application. But of course a simple Google search might not return icons of proper pixel size as you might want. But Icon Finder will. Visit Icon Finder.
  • What The Font
    whatthefont
    You are surfing the web and you come across a font that you can’t take your eyes off. Surely you want to know which font that is. What the Font makes it as easy as it gets. Visit What The Font.
  • Convert Icon
    converticon
    Well of course, it can resize your icons to your selected pixel size. Visit Convert Icon.

I do hope these help you create better, faster,smarter and visually appealing applications!!

The “Values” Folder

While developing Android Applications, one inevitably comes across the Values folder. It is located in <workspace>-><application name>->res. It holds some very important and interesting resources which I am going to tell you about in this post.

  • The strings.xml file is already present when you create a new Application Project in Eclipse. It holds the important strings with their ids.  The manifest file contains the android:label attribute of the application set to @string/app_name. app_name is the id which holds your application name. Similarly it also contains the android:style attribute set to @string/AppTheme. The strings.xml file provides a way to use the same string values in multiple places throughout the application.
    strings
  • In the newer versions of Eclipse the dimens.xml file is also present on the creation of a new application project. It holds the dimensions again mapped with ids. The MainActivity.java file on creation already contains commands that use the dimensions in dimens.xml file.
    dimens
  • One can also create xml files in the values folder. The snippet below shows a colors.xml I creates to use in one of my applications. Like the ones described above it contains the hex code of colors mapped with ids.
    value1
  • The below snippet shows styles.xml file. Depending on the version of the SDK and Eclipse, it might or might not be created on the creation of a new Application project. It contains various styles for layouts.
    styles
  • Remember, that above are just the xml files from one of my applications. You can create any number of xml files to suit your needs. All the values and resources inside them will be accessible from each module of your application.

As you are now familiar with most of the Android Development techniques, you will often require to change and modify the values folder. Keep experimenting!!