Home Blog Page 2079

The Top 10 Linux.com Stories of 2012

 The top 10 most popular original Linux.com stories of 2012 are all excellent stories, and they cover a range of subjects, from distro roundups to news to gnarly howtos. Please enjoy this roundup, and we’ll see you next year!

2012 Top 7 Best Linux Distributions for You

1) Distro roundups are always popular, and 2012 Top 7 Best Linux Distributions for You by Brian Proffitt was a huge hit. It’s a perennial favorite, as Brian scored #2 in last year’s annual hit parade, and the first one that ran in 2010, The Top 7 Best Linux Distributions for You is the all-time most popular Linux.com story.

Scientific Linux: The great distro with the wrong name

2) Scientific Linux: The great distro with the wrong name by me gets second place for the year. Scientific Linux is one of the best Red Hat Enterprise Linux clones, so it’s good to see it getting some attention.

High performance: 94% of worlds top 500 supercomputers run Linux

3) High performance: 94% of worlds top 500 supercomputers run Linux by the excellent Katherine Noyes racked up a lot of eyeballs, and why not? Gloating is fun, and it’s a great showcase for what Linux can do.

30 Linux Kernel Developers in 30 Weeks: Linus Torvalds

4) Jennifer Cloer’s “30 Linux Kernel Developers in 30 Weeks” series has been very successful, and of course the popular inventor of Linux is going to take the #1 spot with 30 Linux Kernel Developers in 30 Weeks: Linus Torvalds.

What Are the Best 10 Linux Desktop Apps?

5) What Are the Best 10 Linux Desktop Apps? by Joe “Zonker” Brockmeier gives some good insights into a selection of Linux desktop applications. Desktop applications for Linux have matured and become so excellent that this could easily become a 100-best list.

SUSE Linux Says Btrfs is Ready to Rock

6) Filesystems always attract a lot of interest, SUSE is a rock-solid distro, and so SUSE Linux Says Btrfs is Ready to Rock by none other than me made the top 10.

Six Linux Distros Born in 2012

7) Katherine Noyes raided the Linux nursery to come up with Six Linux Distros Born in 2012. It’s interesting that two of them include modifications of GNOME 3 to look like GNOME 2.

Weekend Project: Learning Ins and Outs of Arduino

8) Hey, it’s me again! Which goes to show that if you write a whole lot of articles for Linux.com some of them are bound to be read. Weekend Project: Learning Ins and Outs of Arduino came in at #8, and I am pleased to see a lot of interest in Arduino because it’s a wonderful platform for learning both programming and electronics.

Zenoss or Nagios? Your All-Seeing Network Eye in the Sky

9) Networking monitoring is always something we want to do better, so it’s no surprise that Zenoss or Nagios? Your All-Seeing Network Eye in the Sky is popular.

The Linux Talent Draft is On

10) Want a challenging, satisfying career? Calling all Linux nerds: The Linux Talent Draft is On, by Jennifer Cloer, says that demand for skilled Linux talent is growing, and employers are willing to pay well for it.

What will 2013 bring? Cloud, mobile, and gaming.

Send open source, new year cheer

Happy New Year

What better way to say Happy New Year than with an eCard from opensource.com! Send some cheer and encourage your colleagues, friends, and family to read stories about open source, join an open source project, and resolve to be more open in 2013!…Read more at OpenSource.com

iOS 6.0.2 is draining our batteries, some users say

The famed iPhone battery drain issue seems have to resurfaced for some people who’ve made the leap to iOS 6.0.2.

Several users chiming in on Apple’s Discussion Forums say the latest iOS update, which was designed to fix Wi-Fi problems, is draining their batteries faster.

One iOS 6.0.2 updater said that “I can usually get through a day with about 75 percent of my battery power remaining. Today I’ve gone through 90 percent and I’ve done nothing special with it.”

Another said: “Today I barely used my phone at all”….Read more at CNET News

LLVM 3.2 now available

LLVM logoThe latest version of the LLVM compiler infrastructure introduces an improved scalar replacements of aggregates (SROA) model, a loop vectoriser, a new NVPTX backend and a number of other improvements

Read more at The H

Distribution Release: Linux Mint 14 “Xfce”

Clement Lefebvre has announced the release of Linux Mint 14 “Xfce” edition: “The team is proud to announce the release of Linux Mint 14 Xfce. Xfce is a lightweight desktop environment which aims to be fast and low on system resources, while still being visually appealing and user….Read more at DistroWatch

GNOME starts privacy fundraising campaign

GNOME iconThe GNOME Foundations’s executive director, Karen Sandler, has announced a new “Friends of GNOME” fund raising campaign specifically to help make GNOME “one of the most secure computing environments available”, with a particular focus on privacy. Billed as “Help make GNOME safer than ever”, the privacy campaign will fund development of application containment, improved disk encryption support, integration of TOR…Read more at The H

LLVM 3.2 released

Version 3.2 of the LLVM compiler system and Clang C compiler has been released. “Despite only it being a bit over 6 months of development since 3.1, LLVM 3.2 is a huge leap, delivering a wide range of improvements and new features. Clang now includes industry-leading C++’11 support, improved diagnostics, C11 and Objective-C improvements (including ‘ObjC literals’ support), and the Clang static analyzer now has the ability to do inter-procedural (cross- function) analysis along with improved Objective-C support.” See the release notes for lots of details.

Read more at LWN

KDE Develop Lays Roadmap of Kwin For Qt 5

KDE developer Martin Gräßlin has posted a road-map for Kwin on Qt 5. The release of Qt 5 has brought many system optimizations as well as 99% backwards compatibility.

Read more at Muktware

Weekend Project: Become a Linux Contributor

A lot of you fine readers are already contributors to your favorite worthy Linux projects. I’ll wager there are also some who would love to contribute in some way, but aren’t quite sure how. So here are a few ideas to get you inspired and, hopefully, involved.

http://upload.wikimedia.org/wikipedia/commons/6/63/USCurrency_Federal_Reserve.jpgMoney

Many projects accept donations of money. They may have wish lists of hardware for testing, or other items. A little bit is better than zero, so don’t feel badly if you can only give a little.  I suggest focusing on a limited number of projects that you can support regularly, rather than trying to spread your finances too thinly.

Kindness

This is a lot more valuable than you may think. I’m not sure where the “you must have a hide this thick to enter” ethos came from, but it’s bizarre and it doesn’t work. Most people prefer to be treated with courtesy and friendliness, and that goes a long way in building a friendly, productive atmosphere. How to Protect Your Open Source Project From Poisonous People is a fast introduction to the subject.

If you enjoy encouraging people, and helping groups work together, you just might be a born community manager. The Art of Community by Jono Bacon is an excellent resource for anyone nutty enough to think they might want to be a Linux cat-herder.

Help Noobs

Every day there are hordes of new Linux users, and users new to a particular piece of Linux software. Having the patience to help newbies is incredibly valuable, and there are a lot of fairly simple ways to do this without it turning into a time sink. Your #1 resource is a good FAQ. It’s not that hard to assemble and organize one from forum posts and IRC discussions, and it’s a valuable way to help the developers of your favorite projects. Answering questions is a lot easier when you can point people to helpful resources.

Learn to Code

It all starts with the code, and all you need to learn is time and effort. I suggest starting with Bash shell scripting, codebecause it is the default Linux shell, and you’ll need to know it no matter what other languages you learn. Don’t make yourself crazy trying to decide which scripting or programming language to learn first– just pick one. Everyone has their own ideas which ones are essential, and you can overthink yourself right out of even trying to start. Javascript, Python, Ruby, and PHP are all popular, fairly easy to learn, and well-documented. C is an oldtimer that is not going away anytime soon. Basic programming concepts are the same no matter what language you’re using, so as soon as you develop some proficiency with one it’s easier to learn additional languages.

Web Design and Marketing

Don’t let the word “marketing” turn you off because I’m not talking about selling a project, but rather presenting its best face to the world. A lot of Linux and FOSS projects have Web sites that don’t publish useful information. Like what the software does, in plain language. News and howtos are jumbled randomly into single blogs, or there is little useful communication of any kind. A project Web site doesn’t need to be fancy, but it does need to be informative, and organized enough that interested visitors can learn cool things about the project.

Artwork and Multimedia

There are a lot of generous artists contributing beautiful work to Linux projects. Appearance does matter– we stare at these dang things all day long, so they might as well look nice.

Encourage the Boss

If your business relies on Linux software, talk to the boss about supporting it in some way.

Write Howtos

The most brilliant software will just sit there if nobody knows how to use it. “Read the code” is not a substitute for good howtos. (Bruce Byfield offers some guidance on becoming a professional technical writer in Careers in Linux: Technical Writing.)

Users into Contributors

Turning users into contributors is what makes Linux and FOSS work. It takes a lot of different roles to support any software project, so don’t be shy– somewhere out there is the right one for you, where you can do satisfying work and make a difference.

Image credit:

Photo of US currency courtesy Wikimedia Commons, public domain

 

Android Programming for Beginners: Part 1

 Don’t miss part 2!

With Android phones and tablets making their way into more and more pockets and bags, dipping a toe into Android coding is becoming more popular too. And it’s a great platform to code for — the API is largely well-documented and easy to use, and it’s just fun to write something that you can run on your own phone. You don’t even need a phone at first, because you can write and test code in an emulator on your Linux PC.  In the first of this two-part intro to Android coding, get a basic timer app up and running and start learning about the Android API. This tutorial assumes some basic familiarity with Java, XML, and programming concepts, but even if you’re shaky on those, feel free to follow along!

Dev environment and getting started

A note on versions: the most recent version of Android is 4.2 (Jelly Bean), but as you can see from this Wikipedia chart, there aren’t many people using it yet. You’re better off coding for one or both of 4.0 (Ice Cream Sandwich) or 2.3 (Gingerbread), especially as Android is entirely forwards-compatible (so your 2.3 code will run on 4.2) but not always backwards-compatible. The code here should work on either 4.0 or 2.3.

android countdown timer

The quickest way to get your dev environment set up is to download the Android Bundle. You’ll also need JDK 6 (not just JRE); note that Android is not compatible with gcj. If you already have Eclipse, or wish to use another IDE, you can set it up for Android as described here.

Now, create a project called Countdown either using Eclipse, or from the command line. I set the BuildSDK to 4.0.3, and minimum SDK to 2.2, and (in Eclipse) used the BlankActivity template.

 

My First Android Project: Layout

For our very first program, we’re going to do is to show a timer that counts down from 10 seconds when you click a button. Before writing the code, let’s create the interface — what the user will see when they start the app. Open up res/layout/activity_countdown.xmlto create an XML layout, using either the Eclipse graphical editor, or a text/XML editor, to enter this:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >
      <TextView 
          android:id="@+id/time_display_box" 
          android:layout_width="wrap_content" 
          android:layout_height="wrap_content" 
          android:layout_alignParentTop="true" 
          android:layout_centerHorizontal="true" 
          android:layout_marginTop="60dp" 
          android:text="@string/_00_30" 
          android:textAppearance="?android:attr/textAppearanceLarge"/>
      <Button
          android:id="@+id/startbutton"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_below="@+id/time_display_box"
          android:layout_centerHorizontal="true"
          android:layout_marginTop="41dp"
          android:text="@string/start" />
    
</RelativeLayout>

Note the references to @string/start and @string/__00_30. These values are stored in res/values/strings.xml:

<string name="start">Start</string>
<string name="_00_30">00:30</string>

This illustrates the standard way of referring to Android resources. It’s best practice to use string references rather than hard-coding strings.

My First Android Project: Code

Next, open up the CountdownActivity.java file in your editor, ready to write some code. You should already have an onCreate() method stub generated. onCreate() is always called when the Activity is first created, so you’ll often do setup and app logic startup here. (Eclipse may also have created an onCreateOptionsMenu()method stub, which we’ll ignore for now.) Enter this code:

public class CountdownActivity extends Activity {
	
  private static final int MILLIS_PER_SECOND = 1000;
  private static final int SECONDS_TO_COUNTDOWN = 30;
  private TextView     countdownDisplay;
  private CountDownTimer timer;
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_countdown);
        
    countdownDisplay = (TextView) findViewById(R.id.time_display_box);
    Button startButton = (Button) findViewById(R.id.startbutton);
    startButton.setOnClickListener(new View.OnClickListener() {
      public void onClick(View view) {
        try {
          showTimer(SECONDS_TO_COUNTDOWN * MILLIS_PER_SECOND);
        } catch (NumberFormatException e) {
          // method ignores invalid (non-integer) input and waits
          // for something it can use
        }
      }
    });
  }
}

You’ll notice the thing that makes this a surprisingly easy first project: the Android API includes a CountDownTimer that you can use. We set up this, and the countdown display, as private member variables. In onCreate() we use the built-in setContentView method to grab our XML layout The R.foo.barsyntax is a standard way to refer to Android XML resources in your code, so you’ll see it a lot.

findViewById is another method you’ll use a lot; here, it grabs the display and the Start button from the XML layout. For the Button to work when clicked, it needs an OnClickListener. This is an interface, so must be subclassed. We could create a whole new MyButton class to do this, but this is overkill for a single button. Instead, we do it inline, creating a new OnClickListener and its onClick() method. Ours simply calls showTimer() on the number of milliseconds we want to use (currently hard-coded).

So what does showTimer()do?

private void showTimer(int countdownMillis) {
  if(timer != null) { timer.cancel(); }
  timer = new CountDownTimer(countdownMillis, MILLIS_PER_SECOND) {
  @Override
  public void onTick(long millisUntilFinished) {
    countdownDisplay.setText("counting down: " +
    millisUntilFinished / MILLIS_PER_SECOND);
  }
  @Override
    public void onFinish() {
      countdownDisplay.setText("KABOOM!");
    }
  }.start();
}

The CountDownTimer class does most of the work for us, which is nice. Just in case there’s already a running timer, we start off by cancelling it if it exists. Then we create a new timer, setting the number of milliseconds to count down (from the showTimer() parameter) and the milliseconds per count interval. This interval is how often the onTick()callback is fired.

CountDownTimer is another abstract class, and the __onTick()__ and __onFinish()__ methods must be implemented when it is subclassed. We override onTick() to decrease the countdown display by a second on every tick; and override onFinish() to set a display message once the countdown finishes. Finally, start() sets the timer going.

If you select ‘Run’ in Eclipse, you can choose to run this as an Android app, and an emulator will automatically be generated and run for you. Check out the Android docs if you need more information on setting up an emulator, or on running an app from the command line.

Congratulations, you’ve written your first Android app! In the second part of this series, we’ll have a closer look at the structure of an Android app, and make some improvements to the timer to input a countdown time, a Stop button, and menu options. We’ll also look at running it on a physical phone rather than the software emulator.

For more information in the mean time, you can check out the Android Development Training section of The Linux Foundation’s Linux training website.