Planet Apache

Syndicate content
Updated: 10 hours 12 min ago

Bryan Pendleton: Reading my way to Ireland, Part 2: travelogues

Sat, 2014-03-15 16:57

I've always been an easy mark for the travelogue.

Travel guides are fine, but they are very dry. Travelogues make no bones about it: they are personal, and opinionated, and eccentric, and everything that's wonderful about traveling.

I've been lucky to stumble across some nice travelogues about traveling in Ireland:

  • McCarthy's Bar: A Journey of Discovery In Ireland

    This book will be no surprise to anyone who's ever read anything about Ireland. Pete McCarthy was a prolific writer and a prolific traveler and rather a funny man as well. Sadly, he died only a few years after writing this book, but what a good book it is!

    Rather than take the easy way around Ireland, McCarthy goes out of his way to have a real experience. He deliberately gets lost. He sets out in the morning without knowing where he will stay that evening. He takes every opportunity to put himself in situations where he can't just be a spectator. He lives, breathes, sweats, and cries Ireland. And, all the time, you find yourself laughing and crying with him:

    I drove on, stopping a couple of times to go ferreting up mountainsides looking for mass rocks and standing stones. I know this passion for old stones is beginning to seem like an obsession, but when there are no sushi restaurants or art-house cinemas to hang out in, you have to make your own fun. At one point I followed a waterfall up the hillside through ferns and thick woods. At the top, I stopped to gaze out over the mountains, lakes and islands of Kerry, but found myself instead gazing in wonder at the beautiful emerald moss that covered the rocks at my feet. Wow, I thought. At home I go mental trying to get rid of the moss in the garden, but here I realise how beautiful it is. It was a moment of great realisation. I realised the solitude and the natural beauty were turning me soft in the head. It was time to go somewhere with lots of people and buildings, so I could get back in touch with my uncaring, cynical side. I needed quality time in a major tourist trap. I went back to the Tank and hit the road for Killarney.

    It was gorgeous moss though.

    I wish McCarthy had lived longer, to write more, but I'm pleased to have found him nonetheless.

  • Round Ireland in Low Gear

    Eric Newby is rather a well-known travel writer, though this was the first book of his I've read.

    When I read the blurb before buying the book ("Touring Ireland by bicycle in the winter is a daunting prospect even for the most seasoned backpackers, but Newby and his wife Wanda weathered it with good humor and resilience."), I anticipated that I was going to be reading some sort of adventure travel book, about a pair of 20-somethings who sleep in the fields and scale the cliffs in between epic bicycle sprints from one place to the next.

    Oh, how wrong I was!

    It turns out, at the time of this trip, Newby and his wife were in their late 60's, and were only occasional cyclers.

    Moreover, they chose the dead of winter for their trip.

    So large parts of this book involve passages like this:

    In the morning we rode out to a huge white sugar-loaf beacon known as Lot's Wife which looks across a narrow sound to Sherkin Island. The rain had stopped and the sun was shining but the wind was blowing so strongly that we could lean out on it without falling over, which meant it was Force 9. Gouts of froth streamed up the face of a precipice on the extreme edge of which a herd of cattle stood grazing, accompanied by an enormous, wily-looking goat; apparently the cattle often fall over, having neither apprehension nor fear of heights, but never the goat. Having done this there was not much else to do, the mail boat not being due to sail for Clear Island until half past two in the afternoon.

    "I'm afraid I can't go on with much more of this," said Wanda, as we sat in a deep valley leading down to the sea next door to an abandoned Morris done out in jungle camouflage with nothing inside except seatbelts. "The winds and the rains are simply killing me." And she shed a tear or two. Nevertheless she promosed to delay her decision about abandoning both me and Ireland until our return from Clear Island.

    I'm not giving much away to admit that, somehow, they persevere.

    Newby's book is delightful. He's interested in everything: history, culture, scenery, religion, art. In between the two-wheeled stretches, he discusses all sorts of topics, and his writing is fluid and natural.

    If it weren't for McCarthy's Bar, I'd be raving about Round Ireland in Low Gear.

  • Keep to the Left!: Freewheeling through Ireland

    It is, perhaps, easier for Europeans to appreciate Ireland, as they have some idea of what it is that they are seeing, and why it is there.

    We Yanks have it harder. To us, a historical building was built around 1905 or so, and clans and kings and queens are things we only learn about on TV.

    So off go Jesse and Micki Lovelace, two middle-aged Midwesterners, to Ireland, doing their best to approach things with an open mind and let Ireland show itself to them.

    Jesse takes copious notes, and is very good at re-telling what he had for breakfast, and who had the better meal at the pub. At at times it seems like all he manages to do is to make it from one door to the next.

    Our evening was another memorable pub-crawl. There were several pubs we had missed the night before, so we had to take up the slack before we left County Mayo. Our first stop was the Parting Glass. But when he's not simply regurgitating the facts of the matter, he has a lively appreciation for Ireland that makes his book a genuine kick to read: With that reassurance, we returned to Abbeyfeale for dinner. Kathleen had recommended a place called O'Riordan's and had said the food was good and reasonable. We found it, since we had noted it as a landmark a few hours earlier, and went in to have one at the bar. As we were sitting there, a big fellow sat down at the bar next to us. He bore a striking resemblance to Ronan Tynan, the Irish tenor: thin hair, round face, prominent ears (like mine) and an infectious grin.

    Since pub manners prevail, we weren't surprised (or offended) when he struck up a conversation. After the usual "How are you enjoying your holiday?," we got to chatting about things in general. He was (and I hope still is) a police officer (Garda) and had just gotten off duty and dropped into O'Riordan's to unwind. When Micki told him that she was a nurse in a small town hospital, the two of them had a grand old time comparing hairy emergency room stories. People who deal with the wreckage of humanity and the disasters that befall people have a sort of bond that defies all boundaries; they know and understand things that the rest of us are completely clueless about. It was an amazing and inspiring experience to listen to an American nurse and an Iris cop discuss the things they had in common.

    Lovelace's book isn't nearly at the level of the other two, but it's enjoyable and entertaining, and most of all it's heart-felt: Lovelace deeply treasured his trip to Ireland, and his enthusiasm is infectious and pleasing, and I can't say I regret the time I spent reading his stories of his adventures.

Categories: FLOSS Project Planets

Justin Mason: Links for 2014-03-14

Fri, 2014-03-14 18:58
  • Health privacy: formal complaint to ICO

    ‘Light Blue Touchpaper’ notes:

    Three NGOs have lodged a formal complaint to the Information Commissioner about the fact that PA Consulting uploaded over a decade of UK hospital records to a US-based cloud service. This appears to have involved serious breaches of the UK Data Protection Act 1998 and of multiple NHS regulations about the security of personal health information. Let’s see if ICO can ever do anything useful…. not holding my breath

    (tags: ico privacy data-protection dpa nhs health data ross-anderson)

  • Why Google Flu Trends Can’t Track the Flu (Yet)

    It’s admittedly hard for outsiders to analyze Google Flu Trends, because the company doesn’t make public the specific search terms it uses as raw data, or the particular algorithm it uses to convert the frequency of these terms into flu assessments. But the researchers did their best to infer the terms by using Google Correlate, a service that allows you to look at the rates of particular search terms over time. When the researchers did this for a variety of flu-related queries over the past few years, they found that a couple key searches (those for flu treatments, and those asking how to differentiate the flu from the cold) tracked more closely with Google Flu Trends’ estimates than with actual flu rates, especially when Google overestimated the prevalence of the ailment. These particular searches, it seems, could be a huge part of the inaccuracy problem. There’s another good reason to suspect this might be the case. In 2011, as part of one of its regular search algorithm tweaks, Google began recommending related search terms for many queries (including listing a search for flu treatments after someone Googled many flu-related terms) and in 2012, the company began providing potential diagnoses in response to symptoms in searches (including listing both “flu” and “cold” after a search that included the phrase “sore throat,” for instance, perhaps prompting a user to search for how to distinguish between the two). These tweaks, the researchers argue, likely artificially drove up the rates of the searches they identified as responsible for Google’s overestimates. via Boing Boing

    (tags: google flu trends feedback side-effects colds health google-flu-trends)

Categories: FLOSS Project Planets

Christian Grobmeier: The Zen Programmer available for Leanpub Affiliates

Fri, 2014-03-14 18:00

The Zen Programmer is now available in the Leanpub Affiliate Program.

This eBook teaches programmers the powerful use of "Zen" to bring peace and tranquility to their very hectic schedules. Do you know people that could benefit from having Zen in their lives? If so, you should consider becoming an affiliate for this eBook. "The Zen Programmer" is not just for programmers, so if you know any group of people that could benefit having more peace in their lives, sign up for the affiliate program today.

When you join the Leanpub Affiliate Program, you will earn a 50% affiliate commission from each eBook you sell using your affiliate link. You can even promote through your social media just by posting your affiliate link on Facebook and Twitter! (How easy is that?)

With the Leanpub Affiliate Program, there is a cookie automatically set on the visitor's computer for one week - so if they decide in a couple days after visiting your affiliate link that they want to buy, you will still get credit for it!

Affiliates are paid at the beginning of the month when you reach $40 in affiliate commission in your account. You do need PayPal in order to get your affiliate commission, so be sure to have your PayPal email address ready when you sign up for an affiliate account.

All you need to do is sign up for an account online at: https://leanpub.com/affiliates. As soon as you fill out the form, the next page will let you know that you are enrolled. At this screen, you will have access to your unique affiliate link for "The Zen Programmer" book. Bookmark this page in your favorites, and save that affiliate link.

Special note: If you purchased the a copy of the eBook through the Zen Programmer's website at shop.opensource.io, you can have a voucher for the eBook on Leanpub by sending an email to hello@opensource.io.

Categories: FLOSS Project Planets

Nick Kew: Uh-Oh

Fri, 2014-03-14 09:49

Q: When does a stable system start to go bad?
A: When you install a non-open package with privileges.

This morning my laptop with Debian Wheezy has shown its first signs of software trouble outside of my control.  The Cisco AnyConnect VPN client, which I installed to be able to access $employer-intranet from it, refused to start up.  No error messages, just that I double-click the launch icon and nothing happens.

I have some relevant information in syslog:

Mar 14 08:43:57 mimir vpnui[861]: Function: ClientIfcBase File: ClientIfcBase.cpp Line: 162 Initializing vpnapi version 2.5.3051 ().
Mar 14 08:43:57 mimir vpnui[861]: Function: loadProfiles File: ProfileMgr.cpp Line: 112 No profile is available.
Mar 14 08:43:57 mimir vpnui[861]: Function: fileExists File: Utility/sysutils.cpp Line: 500 Invoked Function: _tstat Return Code: 2 (0×00000002) Description: unknown File: /opt/cisco/vpn/AnyConnectLocalPolicy.xml Error: No such file or directory
Mar 14 08:43:57 mimir vpnui[861]: Current Preference Settings: CertificateStoreOverride: false CertificateStore: All ShowPreConnectMessage: false AutoConnectOnStart: false MinimizeOnConnect: true LocalLanAccess: false AutoReconnect: true AutoUpdate: true ProxySettings: Native AllowLocalProxyConnections: true PPPExclusion: Disable PPPExclusionServerIP: EnableScripting: false TerminateScriptOnNextEvent: false AuthenticationTimeout: 12
Mar 14 08:43:57 mimir vpnui[861]: Function: CvcGtkNotifyBalloon File: CvcGtkNotifyBalloon.cpp Line: 87 Invoked Function: dlopen Return Code: -33554427 (0xFE000005) Description: libnotify.so.1: cannot open shared object file: No such file or directory
Mar 14 08:43:57 mimir vpnui[861]: Function: connectTransport File: IPC/SocketTransport_unix.cpp Line: 711 Invoked Function: ::connect Return Code: 111 (0x0000006F) Description: unknown
Mar 14 08:43:57 mimir vpnui[861]: Function: connectIpc File: IPC/IPCTransport.cpp Line: 246 Invoked Function: CSocketTransport::connectTransport Return Code: -31522804 (0xFE1F000C) Description: SOCKETTRANSPORT_ERROR_CONNECT
Mar 14 08:43:57 mimir vpnui[861]: Function: terminateIpcConnection File: IPC/IPCTransport.cpp Line: 385 Invoked Function: CSocketTransport::writeSocketBlocking Return Code: -31522783 (0xFE1F0021) Description: SOCKETTRANSPORT_ERROR_NOT_CONNECTED
Mar 14 08:43:57 mimir vpnui[861]: Function: initIpc File: ApiIpc.cpp Line: 299 Invoked Function: CIpcTransport::connectIpc Return Code: -31522804 (0xFE1F000C) Description: SOCKETTRANSPORT_ERROR_CONNECT
Mar 14 08:43:57 mimir vpnui[861]: Function: initiateAgentConnection File: ApiIpc.cpp Line: 214 Invoked Function: ApiIpc::initIpc Return Code: -31522804 (0xFE1F000C) Description: SOCKETTRANSPORT_ERROR_CONNECT
Mar 14 08:43:57 mimir vpnui[861]: Function: attach File: ClientIfcBase.cpp Line: 405 Client failed to attach.
Mar 14 08:43:57 mimir vpnui[861]: Function: run File: ApiIpc.cpp Line: 387 Invoked Function: ApiIpc::initiateAgentConnection Return Code: -31522804 (0xFE1F000C) Description: SOCKETTRANSPORT_ERROR_CONNECT
Mar 14 08:43:58 mimir vpnui[861]: Function: detach File: ClientIfcBase.cpp Line: 288 Shutting down vpnapi

OK, that gives me some things to check and messages to google. Lots of results, people experiencing similar though not identical grief.  Seems often to happen when something gets upgraded.  OK, let’s see if reinstalling the VPN client fixes anything.

But first, ensure the system is fully up-to-date.  Now apt gives me another, rather more worrisome message, repeated many times:

insserv: Starting vpnagentd_init depends on minissdpd and therefore on system facility `$all’ which can not be true!

Dammit, it’s running an agent behind my back.  Grrr …

After that, re-installing the VPN client fixed it, and I may have to repeat that when I reboot in future (which I rarely do – suspend is more convenient).  But now I have a system error.  Is this the start of a slippery slope to an unstable system?

A promising solution is here.  Let’s hope!


Categories: FLOSS Project Planets

Sam Ruby: Angular.rb example

Fri, 2014-03-14 07:49

Tim Bray: If hating this is wrong, I don’t want to be right.

Perhaps you would like this better?  :-)

module Angular::X controller :LoginController do @credentials = {username: '', password: ''} def login(credentials) AuthService.login(credentials).then { broadcast! AUTH_EVENTS.loginSuccess }.catch { broadcast! AUTH_EVENTS.loginFailure } end end end

Try it here.

Things to note:

  • All dependency injection is taken care of for you
  • $scope and $rootScope are inferred based on context
  • Input uses Ruby syntax vs JS Syntax
  • Generated code is clean, indented, and idiomatic

More examples, from deployed code: roster, agenda.

This will be the covered by my ApacheCon talk.

Categories: FLOSS Project Planets

Apache Wicket Community News: Header contributions positioning

Fri, 2014-03-14 07:47
Wicket 6.0.0 came with some nice improvements in the header contribution management. With these improvements it is possible to put a specific header contribution at the top of all others by using PriorityHeaderItem, or to group several header contributions in a specific spot in the page body by using FilteredHeaderItem, but still it was quite […]
Categories: FLOSS Project Planets

Matt Raible: Developing with AngularJS - Part III: Services

Fri, 2014-03-14 07:43

This is the 3rd article in a series on my experience developing with AngularJS. I used AngularJS for several months to create a "My Dashboard" feature for a client and learned a whole bunch of Angular goodness along the way. For previous articles, please see Part I: The Basics and Part II: Dialogs and Data.

Angular offers several ways to interact with data from the server. The easiest way is to use the $resource factory, which lets you interact with RESTful server-side data sources. When we started the My Dashboard project, we were hoping to interact with a REST API, but soon found out that it didn't have all the data we needed. Rather than loading the page and then making another request to get its data, we decided to embed the JSON in the page. For communication back to the server, we used our tried-and-true Ajax solution: DWR.

In Angular-speak, services are singletons that carry out specific tasks common to web apps. In other words, they're any $name object that can be injected into a controller or directive. However, as a Java Developer, I tend to think of services as objects that communicate with the server. Angular's documentation on Creating Services shows you various options for registering services. I used the angular.Module api method.

When I last worked on the project, there were only two services in My Dashboard: Widget and Preferences.

Widget Service

The Widget service is used to retrieve the visible widgets for the user. It has two functions that are exposed to controllers: getUserWidgets(type) and getHiddenWidgets(type). The former function is used at the top of WidgetController, while the latter is used for the configuration dialog mentioned in the previous article.

The code for this service is in services.js. The bulk of the logic is in its filterData() function, where it goes through a 4-step process:

  1. Get all the widgets by type, ensuring they're unique.
  2. Remove the widgets that are hidden by the user's preferences.
  3. Build an array that's ordered by user's preferences.
  4. Add any new widgets that aren't hidden or ordered.

The code for the Widget object is as follows:

angular.module('dashboard.services', []). factory('Widget',function ($filter, Preferences) { var filter = $filter('filter'); var unique = $filter('unique'); function filterData(array, query) { // get all possible widgets for a particular type var data = filter(array, query); data = unique(data); // remove widgets that are hidden by users preference var hidden = Preferences.getHiddenWidgets(query.type); for (var i = 0; i < hidden.length; i++) { var w = filter(data, {id: hidden[i]}); $.each(w, function (index, item) { var itemId = item.id; if (hidden.indexOf(itemId) > -1) { data.splice(data.indexOf(item), 1); } }); } // build an array that's ordered by users preference var ordered = []; var visible = Preferences.getUserWidgets(query.type); for (var j = 0; j < visible.length; j++) { var v = filter(data, {id: visible[j]}); $.each(v, function (index, item) { var itemId = item.id; if (visible.indexOf(itemId) > -1) { ordered.push(item) } }); } // loop through data again and add any new widgets not in ordered $.each(data, function (index, item) { if (ordered.indexOf(item) === -1) { ordered.push(item); } }); return ordered; } return { getUserWidgets: function (type) { return filterData(widgetData, {type: type}) }, getHiddenWidgets: function (type) { var hidden = Preferences.getHiddenWidgets(type); var widgetsForType = filter(widgetData, {type: type}); widgetsForType = unique(widgetsForType); var widgets = []; for (var j = 0; j < hidden.length; j++) { var v = filter(widgetsForType, {id: hidden[j]}); $.each(v, function (index, item) { if (widgetsForType.indexOf(item) > -1) { widgets.push(item) } }); } return widgets; } } })

Once you have a service configured like this, you can inject it by name. For example, WidgetController has Widget injected into its constructor:

function WidgetController($dialog, $scope, Widget, Preferences) { Preferences Service

The Preferences service is used to get and save user preferences. It's pretty straightforward and the bulk of its code is interacting with DWR. This service has 5 methods:

  1. getHiddenWidgets(type) - used by Widget service
  2. getUserWidgets(type) - used by Widget service
  3. saveBarOrder(bars) - called from WidgetController
  4. saveWidgetOrder(type, widgets) - called from WidgetController
  5. saveWidgetPreferences(type, widgets) - called from WidgetController

First, let's take a look at the save*Order() functions. There are two parts of the page that use the ui-sortable directive to initialize drag-and-drop functionality. The first is on the main <ul> that holds the 3 bars on the left.

<ul class="widgets" ui-sortable="{handle:'.heading', update: updateBars}">

The "update" property in the configuration JSON indicates which method to call in the controller. Similarly, the tasks and summary items call an updateOrder function.

<ul class="summary-items" ng-model="summaryWidgets" ui-sortable="{update: updateOrder}"> ... <ul class="task-items" ng-model="taskWidgets" ui-sortable="{update: updateOrder}">

These functions are in WidgetController and build an array of widget ids to pass to the Preferences service.

$scope.updateBars = function(event, ui) { var bars = []; $.each($(ui.item).parent().children(), function (index, item) { bars.push(item.id.substring(0, item.id.indexOf('-'))) }); Preferences.saveBarOrder(bars); }; $scope.updateOrder = function(event, ui) { var parentId = $(ui.item).parent().parent().attr('id'); var type = parentId.substring(0, parentId.indexOf('-')); var items = []; $.each($(ui.item).parent().children(), function (index, item) { items.push(item.id.substring(item.id.indexOf('-') + 1)) }); Preferences.saveWidgetOrder(type, {items: items}); };

The bar order is used when the page is loaded. The following scriptlet code exists at the bottom of the app's page, in its $(document).ready:

<% String barOrder = user.getDashboardBarSortOrder(); if (barOrder != null) { %> sortBars(['<%= barOrder %>']); <% } %>

The sortBars() function is in a dashboard.js file (where we put all non-Angular functions):

function sortBars(barOrder) { // Sort bars according to user preferences $.each(barOrder, function(index, item) { var bar = $('#' + item + '-bar'); if (bar.index() !== index) { if (index === 0) { bar.insertBefore($('.widgets>li:first-child')); } else if (index === (barOrder.length - 1)) { bar.insertAfter($('.widgets>li:last-child')); } else { bar.insertBefore($('.widgets>li:eq(' + index + ')')); } } }); }

Now that you've seen where Preferences is called from, let's take a look at the code for the service.

The checks for undefined and uniqueness in the code below shouldn't be necessary, but I prefer defensive coding. factory('Preferences', function ($filter) { var unique = $filter('unique'); return { // Get in-page variable: hiddenWidgets getHiddenWidgets: function (type) { var items = hiddenWidgets[type]; return (angular.isUndefined(items) ? [] : unique(items)); }, // Get in-page variable: userWidgets getUserWidgets: function (type) { var items = userWidgets[type]; return (angular.isUndefined(items) ? [] : unique(items)); }, // Save main bar (task, summary, chart) order saveBarOrder: function (bars) { DWRFacade.saveDashboardBarSortOrder(bars, { errorHandler: function (errorString) { alert(errorString); } }) }, // Save order of widgets from sortable saveWidgetOrder: function (type, widgets) { userWidgets[type] = widgets.items; DWRFacade.saveDashboardWidgetPreference(type, widgets, { errorHandler: function (errorString) { alert(errorString); } }); }, // Save hidden and visible (and order) widgets from config dialog saveWidgetPreferences: function (type, widgets) { // widgets is a map of hidden and visible var hiddenIds = []; $.each(widgets.hidden, function (index, item) { hiddenIds.push(item.id); }); var visibleIds = []; $.each(widgets.items, function (index, item) { visibleIds.push(item.id); }); var preferences = { hidden: hiddenIds, items: visibleIds }; // reset local variables in page hiddenWidgets[type] = hiddenIds; userWidgets[type] = visibleIds; DWRFacade.saveDashboardWidgetPreference(type, preferences, { errorHandler: function (errorString) { alert(errorString); } }); } } }) Using $http and Receiving Data

In this particular application, we didn't do any reading from the server with Angular. We simply wrote preferences to the server, and updated embedded variables when data changed. Real-time functionality of the app wouldn't be noticeable if a write failed.

In my current Angular project, it's more of a full-blown application that does as much reading as writing. For this, I've found it useful to either 1) pass in callbacks to services or 2) use Angular's event system to publish/subscribe to events.

The first method is the easiest, and likely the most familiar to JavaScript developers. For example, here's the controller code to remove a profile picture:

Profile.removePhoto($scope.user, function (data) { // close the dialog $scope.close('avatar'); // success message using toastr: http://bit.ly/14Uisgm Flash.pop({type: 'success', body: 'Your profile picture was removed.'}); })

And the Profile.removePhoto() method:

removePhoto: function (user, callback) { $http.post('/profile/removePhoto', user).success(function (response) { return callback(response); }); }

The second, event-driven method works equally as well, but can easily suffer from typos in event names.

// controller calling code Profile.getUser(); // service code getUser: function () { $http.get('/profile').success(function (data) { if (data.username) { $log.info('Profile for ' + data.username + ' retrieved!'); $rootScope.$broadcast('event:profile', data); } }); } // controller receiving code $rootScope.$on('event:profile', function (event, data) { $scope.user = data; });

I like both methods, but the event-driven one seems like it could offer more extensibility in the future.

Summary

Using in-page variables and DWR doesn't seem to be recommended by the Angular Team. However, it worked well for us and seems like a good way to construct Angular services. Even if a REST API becomes available to get all the data, I think using in-page variables to minimize requests is a good idea.

When retrieving data, you can use callbacks or Angular's pub/sub event system ($broadcast and $on) to get data in your controllers. If you want to learn more about this technique, see Eric Terpstra's Communicating with $broadcast. In his article, Eric mentions Thomas Burleson's pub/sub module that acts as a message queue. If you've used Thomas's MessageQueue (or something similar) with Angular, I'd love to hear about your experience.

In the next article, I'll talk about how we redesigned My Dashboard and used CSS3 and JavaScript to implement new ideas.

Categories: FLOSS Project Planets

Senthil Kumaran: Running unit tests for LAVA server

Fri, 2014-03-14 02:42

Linaro Automated Validation Architecture popularly called LAVA is composed of different components. One of the core components in the LAVA framework is the lava-server component. LAVA developers in the recent past made sure that lava-server's unit tests are working properly and relevant to current code base. As a developer of LAVA I hit this issue everytime I want to run unit tests for lava-server (when I switch environments), mainly due to postgresql dependency. Following are stuff you need to setup in order to run unit tests in LAVA. (Do not do this production deployment, only recommended for dev mode deployments)

lava-master is the default postgresql user created for administering LAVA related databases. In order to run unit tests, the default postgresql user of LAVA should have permissions to create and drop databases. The test database created by LAVA unit test is called 'test_lava-master'. The 'lava-master' user creates and destroys this 'test_lava-master' database each time the unit tests are run. You must be 'root' user in order to perform the following operations:

Initialize the environment for LAVA instance.

root@suchi:~# . /srv/lava/instances/<instance_name>/bin/activate

Login as postgres user

(master)root@suchi:~# su postgres

Use the psql client to connect to postgresql.

postgres@suchi:~$ psql
psql (9.1.11)
Type "help" for help.

postgres=# alter user "lava-master" with superuser;
ALTER ROLE
postgres=# \q
postgres@suchi:~$ exit

We have successfully made 'lava-master' user as the superuser and ready to run unit tests. Use the following command to run unit tests for lava_scheduler_daemon

(master)root@suchi:~# lava-server manage test lava_scheduler_daemon
Creating test database for alias 'default'...
FATAL ERROR - The following SQL query failed: CREATE LANGUAGE plpgsql
The error was: language "plpgsql" already exists

...............
----------------------------------------------------------------------
Ran 15 tests in 3.853s

OK
Destroying test database for alias 'default'...

Following command runs the unit tests for lava_scheduler_app

(master)root@suchi:~# lava-server manage test lava_scheduler_app
Creating test database for alias 'default'...
FATAL ERROR - The following SQL query failed: CREATE LANGUAGE plpgsql
The error was: language "plpgsql" already exists

dataview-specific database connection not available, dataview query is NOT sandboxed
dataview-specific database connection not available, dataview query is NOT sandboxed
.......................................
----------------------------------------------------------------------
Ran 39 tests in 3.496s

OK
Destroying test database for alias 'default'...

For more verbose output pass '-v' option with values 2 or 3. Have a look at the following command for more options in running unit tests.

(master)root@suchi:~# lava-server manage test --help

Know more about:

Linaro - http://www.linaro.org

LAVA - http://www.linaro.org/engineering/engineering-groups/lava

Share:
Categories: FLOSS Project Planets

Justin Mason: Links for 2014-03-13

Thu, 2014-03-13 18:58
Categories: FLOSS Project Planets

Sam Ruby: Time Warner Rate Hike

Thu, 2014-03-13 18:48

Backdrop:

  • Google Fiber announces it is considering new cities, including Raleigh.
  • RST announces gigabit service for Raleigh, starting as early as May.
  • My current service is “Standard Cable” (70+ channels, no premium ones) and “Standard Internet” (nominally 15 Mbps up, 1 Mbs down).  At the end of the month, I will have had basic cable with Time Warner at the same location for 22 contiguous years, and standard Internet for more than half of that.

With that context, today I got in the mail notification that my rates are set to go up by 60% as my “Promotional” rates (Seriously?  A twenty two year long promotion?) will be expiring.  After spoofing my User Agent as the chat function doesn’t recognize my browser/operating system combination, I verified this is indeed the plan with “Veronica”.  I was then provided a transcript and directed to an online survey when promptly logged me off without submitting my feedback once I had completed it.

I plan to follow up with @TWC_Help.

Categories: FLOSS Project Planets

Bryan Pendleton: The water wars intensify

Thu, 2014-03-13 17:40

  • East Bay Water District Eyes Emergency Supply From Sacramento RiverIt would mark the first time EBMUD has used a supply of water it first arranged to purchase from the U.S. Bureau of Reclamation in 1970. The agreement would have allowed the district to pump as much as 150,000 acre-feet of emergency water from the American River east of Sacramento. After decades of environmental litigation, the district became partners with the Sacramento County Water Agency in a $900 million project that looks much different from the original plan.

    The two agencies jointly built a pumping plant on the Sacramento River in Freeport, just south of the capital city. The plant, opened in 2011, allows EBMUD to ship water from the Sacramento through a series of canals to its Mokelumne Aqueduct, which serves the East Bay. Under its contract with the Bureau of Reclamation, EBMUD can draw on the Sacramento River supply only during dry years.

  • California to dam Delta sloughs if drought persistsThe temporary dams would consist of rock barriers piled across the entrance to three Delta channels: Sutter Slough and Steamboat Slough, branching off the Sacramento River near Courtland; and False River, branching off the San Joaquin River near Oakley.

    In the case of the first two sloughs, DWR project manager Mark Holderman said the goal is to make the most of limited freshwater outflows that might be available in the main stem of the Sacramento River. The barriers would allow that fresh water to be held in the river, rather than branching into the side channels. This would concentrate its force and better hold back sediment that naturally would creep in from San Francisco Bay as river flows dwindle because of the drought.

Categories: FLOSS Project Planets

Justin Mason: Links for 2014-03-12

Wed, 2014-03-12 18:58
  • Sacked Google worker says staff ratings fixed to fit template

    Allegations of fixing to fit the stack-ranking curve: ‘someone at Google always had to get a low score “of 2.9”, so the unit could match the bell curve. She said senior staff “calibrated” the ratings supplied by line managers to ensure conformity with the template and these calibrations could reduce a line manager’s assessment of an employee, in effect giving them the poisoned score of less than three.’

    (tags: stack-ranking google ireland employment work bell-curve statistics eric-schmidt)

  • Corporate Tax 2014: Irish Government’s “flawed premise” on Apple’s avoidance

    According to our calculation about €40bn or over 40% of Irish services exports of €90bn in 2012 and related national output, resulted from global tax avoidance schemes. It is true that Ireland gains little from tax cheating but at some point, the US tax system will be reformed and a territorial system where companies are only liable in the US on US profits, would only be viable if there was a disincentive to shift profits to non-tax or low tax countries. The risk for Ireland is that a minimum foreign tax would be introduced that would be greater than the Irish headline rate of 12.5%. It’s also likely that US investment in Ireland would not have been jeopardized if Irish politicians had not been so eager as supplicants to doff the cap. Nevertheless today it would be taboo to admit the reality of participation in massive tax avoidance and the Captain Renaults of Merrion Street will continue with their version of the Dance of the Seven Veils.

    (tags: apple tax double-irish tax-avoidance google investment itax tax-evasion ireland)

  • An online Magna Carta: Berners-Lee calls for bill of rights for web

    TimBL backing the “web we want” campaign — https://webwewant.org/

    (tags: freedom gchq nsa censorship internet privacy web-we-want human-rights timbl tim-berners-lee)

  • How the search for flight AF447 used Bayesian inference

    Via jgc, the search for the downed Air France flight was optimized using this technique: ‘Metron’s approach to this search planning problem is rooted in classical Bayesian inference, which allows organization of available data with associated uncertainties and computation of the Probability Distribution Function (PDF) for target location given these data. In following this approach, the first step was to gather the available information about the location of the impact site of the aircraft. This information was sometimes contradictory and filled with ambiguities and uncertainties. Using a Bayesian approach we organized this material into consistent scenarios, quantified the uncertainties with probability distributions, weighted the relative likelihood of each scenario, and performed a simulation to produce a prior PDF for the location of the wreck.’

    (tags: metron bayes bayesian-inference machine-learning statistics via:jgc air-france disasters probability inference searching)

  • How the NSA Plans to Infect ‘Millions’ of Computers with Malware – The Intercept

    The implants being deployed were once reserved for a few hundred hard-to-reach targets, whose communications could not be monitored through traditional wiretaps. But the documents analyzed by The Intercept show how the NSA has aggressively accelerated its hacking initiatives in the past decade by computerizing some processes previously handled by humans. The automated system – codenamed TURBINE – is designed to “allow the current implant network to scale to large size (millions of implants) by creating a system that does automated control implants by groups instead of individually.” In a top-secret presentation, dated August 2009, the NSA describes a pre-programmed part of the covert infrastructure called the “Expert System,” which is designed to operate “like the brain.” Great. Automated malware deployment to millions of random victims. See also the “I hunt sysadmins” section further down…

    (tags: malware gchq nsa oversight infection expert-systems turbine false-positives the-intercept surveillance)

Categories: FLOSS Project Planets

Colm O hEigeartaigh: Apache CXF Authentication and Authorization test-cases

Wed, 2014-03-12 11:18
I've recently uploaded some test-cases to github that show different ways to authenticate and authorize a web services invocation using Apache CXF. Each project has the same two simple use-cases:
  • A JAX-WS request where the service requires a WS-Security UsernameToken over TLS.
  • A JAX-WS request where the service requires HTTP Basic Auth over TLS.
Each project has an "AuthenticationTest" that just illustrates some tests (including negative tests) for authentication, and then an "AuthorizationTest" that relies on authorizing the client based on roles that are retrieved as part of the authentication process somehow. The projects are as follows:
  • cxf-ldap: This project uses JAAS to authenticate a user via LDAP to a Apache Directory backend. The roles are also retrieved for the AuthorizationTest.
  • cxf-shiro: This project uses Apache Shiro for authentication and authorization.
  • cxf-spring-security: This project uses Spring Security for authentication and authorization.
  • cxf-syncope: This project uses the REST API of Apache Syncope for authenticating and authorizating users.
Feel free to download and play around with the projects.
Categories: FLOSS Project Planets

Emmanuel Lecharny: Courteline, 2014...

Wed, 2014-03-12 05:52
Cela fait bientôt dix ans que je paye mes impôts sur internet. A part les premières années, où c'était compliqué - surcharge du serveur, mise en place de certificat, etc -, tout fonctionne.

Le gouvernement a lancé ce qu'il appelle un "choc de simplification".

On en voit les conséquences au fur et à mesure. Par exemple, le recensement peut se faire sur Internet.

Mais c'est lent. Très lent...

Typiquement, si vous organisez une conférence en France, et que vous voulez faire venir des intervenants de pays "exotiques" - l'Inde par exemple..., il vous faudra passer par toute une série de mesures vexatoires, mais surtout inutiles, pour bien vous faire sentir que quand même, il y a un énorme risque que l'intervenant demande l'asile politique ou simplement décide de rester en France, ce pays merveilleux où les écoutes téléphoniques sont légales (mais c'est une autre histoire).

Typiquement, vous devez produire la preuve que :
  • vous avez de quoi héberger la personne chez vous si vous vous proposez de l'accueillir
  • vous gagnez assez d'argent pour assurer sa présence (comptez 50€ par jour, amenez votre feuille d'imposition)
  • vous habitez bien là où vous prétendez habiter (prévoir au moins 2 justificatifs de domicile)
Par ailleurs, il vous faudra acquitter la modique somme de 30€ pour ces démarches terriblement utiles, et bien sûr, sous la forme d'un timbre fiscal. Oui, un TIMBRE en papier...

Du côté de l'intervenant, c'est encore pire :
  • demande de visa au moins 1 mois à l'avance
  • visite au consulat le plus proche (compter 600km en moyenne en Inde, il n'y a que 3 consulats français en Inde)
 Bref...

Ce matin, je décide de faire établir une procuration pour les élections municipales qui arrivent à grand pas. Je n'ai jamais raté une élection, mais là, je serai aux Etats-Unis. Qu'à cela ne tienne...

Donc, hop, choc de simplification en action, suite à une campagne de publicité sur toutes les radios publiques ("Oui, vous pouvez vous simplifier la vie en remplissant votre procuration sur internet". Mon cul !)

Déjà, impossible de le faire en ligne. Il faut se rendre au commissariat de police (ils n'ont que ça à foutre, j'imagine !) ou au tribunal d'instance. En même temps, il y a 2.5 millions fonctionnaires d'état, il faut bien les occuper. Ok, pourquoi pas...

Mais arrivé là-bas avec mon formulaire rempli, on me dit qu'il faut remplir à la main la fiche cartonnée qui n'est que l'exacte reproduction de ce que j'ai apporté.

La raison ? Aucune. "Une circulaire nous interdit d'accepter les formulaires CERFA imprimés mais remplis à la main...".

Ben voyons...

Et me voilà en train de remplir A LA MAIN le formulaire cartonné...

2014... Relire Courteline...


Categories: FLOSS Project Planets

Justin Mason: Links for 2014-03-11

Tue, 2014-03-11 18:58
Categories: FLOSS Project Planets

Edward J. Yoon: 대한민국의 데이터 규모는?

Tue, 2014-03-11 01:48
위키피디아에 따르면 국내 최대포탈 네이버의 하루 평균 페이지뷰는 860,000,000. 웹로그 한 라인의 평균을 150 bytes라고 계산하면 (referrer URL 추가해서 이정도라고 계산),

하루: 196 GB
일년: 69 TB
10년: 698 TB

99년도 창립 이후 지금까지 14년정도 운영해왔으니 대충 계산해도 access log는 700 TB정도 밖에 안되는거다.

그럼 페타바이트 규모의 데이터는 어디에?

무시무시한 속도로 생성되는 웹 문서, 웹 메일 정도 되겠다. 검색엔진 서비스 개선을 위한 페이지랭크, 스팸필터링, 그리고 문서 클러스터링 요런거 말고 할 것이 별로 없다 (이런 필요성에 MapReduce 모델이 나온 것이다). 아마 분석보다는 스토리지 문제에 포커싱해야겠지.

이런 데이터가 전체 데이터의 90% 이상을 차지하는 것이고, 오늘날 빅데이터가 말하는 "사용자 성향 분석", "추천엔진" 뭐 그런 것들에 필요한 인풋 데이터는 실질적으로 네이버 규모에서도 그 사이즈가 GB ~ TB 수준일 수 밖에 없다.

그러면, 네이버 웹스케일이 아닌 다른 회사들의 전자데이터는 과연 얼마나 될까? :-) 

뭐 외국도 사실 마찬가지다. 몇 테라바이트 트윗 데이터에서 어떤 분석을 위해 사용자 인터렉션 구조를 추출해봐야 몇 GB 되지 않는다.

고급 분석에서는 데이터 사이즈가 문제되는게 아니고 계산 복잡도가 문제인 것을 사람들은 알아야해.
Categories: FLOSS Project Planets

Mark Miller: Reshared post from Toke Eskildsen:

Mon, 2014-03-10 19:25

Original Post from Toke Eskildsen:

We finally got our first 1TB  #solr  index (1 out of estimated 20) to play with. It contains 420M web documents. +Thomas Egense experimented with faceting and it worked fairly well on the low-cardinality fields such as MIME-type. For the high-cardinality URL-field, with hundreds of millions unique values, standard Solr field faceting is not possible and our home brew required a 16GB heap. On the positive side, it did give us response times around 1 second, which I find very acceptable with that setup.

Okay, so we do not really need to facet on URL and we have planned a rebuild with DocValues anyway, but a challenge is a challenge. As the index is single segment and the field is single valued, there is a lot of flexible structures that can be trimmed down.

An even tougher challenge is the facet with HTML-elements. It turns out that there are 5B+ references from documents to those. Even if we hack the PackedInts structures to use long as index, it will still require gigabytes. This looks like a good test case for off-heap allocations.  #heliosearch  

Categories: FLOSS Project Planets

Justin Mason: Links for 2014-03-10

Mon, 2014-03-10 18:58
Categories: FLOSS Project Planets

Bryan Pendleton: Gorgeous Internet maps

Mon, 2014-03-10 18:09

CNN have a beautiful gallery online: This is what the Internet actually looks like: The undersea cables wiring the Earth

The information age is powered by thin fiber-optic cables buried in the sea bed, spreading between continents to connect the most remote corners of the planet. These great arteries account for practically all of our international web traffic, and each one has been logged by Washington research firm Telegeography in its interactive Submarine Cable Map 2014. The company's research director Alan Mauldin told CNN about the world's underwater networks.

The full map is on the TeleGeography web site: Submarine Cable Map 2014.

I'd love to buy the full map for my wall at work, but it's a bit out of my price range. To be accurate, it's priced at about 10x what I'd be willing to pay.

Still, the online version of the map is simply beautiful.

Are the cables actually "buried in the sea bed"? For some reason I thought they were just resting on top of the sea floor.

Wow, has it really been 18 years since Neal Stephenson wrote Mother Earth Mother Board ? Time sure passes quickly...

Here's what Stephenson said, at the time:

The amplifiers need power - up to 10,000 volts DC, at 0.9 amperes. Since public 10,000-volt outlets are few and far between on the bottom of the ocean, this power must be delivered down the same cable that carries the fibers. The cable, therefore, consists of an inner core of four optical fibers, coated with plastic jackets of different colors so that the people at opposite ends can tell which is which, plus a thin copper wire that is used for test purposes. The total thickness of these elements taken together is comparable to a pencil lead; they are contained within a transparent plastic tube. Surrounding this tube is a sheath consisting of three steel segments designed so that they interlock and form a circular jacket. Around that is a layer of about 20 steel "strength wires" - each perhaps 2 mm in diameter - that wrap around the core in a steep helix. Around the strength wires goes a copper tube that serves as the conductor for the 10,000-volt power feed. Only one conductor is needed because the ocean serves as the ground wire. This tube also is watertight and so performs the additional function of protecting the cable's innards. It then is surrounded by polyethylene insulation to a total thickness of about an inch. To protect it from the rigors of shipment and laying, the entire cable is clothed in good old-fashioned tarred jute, although jute nowadays is made from plastic, not hemp.

Oh wait, no, there's more later (Stephenson wrote a LONG article...). Here it is:

At Tong Fuk, FLAG is encased in pipe out to a distance of some 300 meters from the beach manhole. When the divers have got all of that pipe bolted on, which will take a week or so, they will make their way down the line with a water jet that works by fluidizing the seabed beneath it, turning it into quicksand. The pipe sinks into the quicksand, which eventually compacts, leaving no trace of the buried pipe.

Beyond 300 meters, the cable must still be buried to protect it from anchors, tickler chains, and otter boards (more about this later).

Well, that wasn't it, exactly, as that's still talking about the part where the cable reaches land. How about this part:

These nozzles fluidize the seabed and thus make it possible for the giant blade to penetrate it. Along the trailing edge of the blade runs a channel for the cable so that as the blade works its way forward, the cable is gently laid into the bottom of the slit. The barge carries a set of extensions that can be bolted onto the top of the injector so it can operate in water as deep as 40 meters, burying the cable as deep as 9 meters beneath the seabed. This sufficed to lay the cable out for a distance of 10 kilometers from Tong Fuk. Later, another barge, the Chinann, will come to continue work out to 100 meters deep and will bury both legs of the FLAG cable for another 60 kilometers out to get them through a dangerous anchorage zone.

Still seems like we're talking about the part close to shore.

OK, no, here it is (I knew I remembered it):

The route between the landing station at Songkhla, Thailand, and the one at Lan Tao Island, Hong Kong, might have a certain length when measured on a map, say 2,500 kilometers. But if you attach a 2,500-kilometer cable to Songkhla and, wearing a diving suit, begin manually unrolling it across the seafloor, you will run out of cable before you reach the public beach at Tong Fuk. The reason is that the cable follows the bumpy topography of the seafloor, which ends up being a longer distance than it would be if the seafloor were mirror-flat.

Over long (intercontinental) distances, the difference averages out to about 1 percent, so you might need a 2,525-kilometer cable to go from Songkhla to Lan Tao. The extra 1 percent is slack, in the sense that if you grabbed the ends and pulled the cable infinitely tight (bar tight, as they say in the business), it would theoretically straighten out and you would have an extra 25 kilometers. This slack is ideally molded into the contour of the seafloor as tightly as a shadow, running straight and true along the surveyed course. As little slack as possible is employed, partly because cable costs a lot of money (for the FLAG cable, $16,000 to $28,000 per kilometer, depending on the amount of armoring) and partly because loose coils are just asking for trouble from trawlers and other hazards. In fact, there is so little slack (in the layperson's sense of the word) in a well-laid cable that it cannot be grappled and hauled to the surface without snapping it.

So at least when Stephenson wrote about this, twenty years ago, the cable was only buried in the seabed close to shore, to prevent it from being damaged by dragging anchors and other dangerous things that arise in the shallow ocean close to land.

Out deeper, they just laid it down on the sea floor.

So, has that changed? If you know, let me know.

Categories: FLOSS Project Planets

Heshan Suriyaarachchi: Fixing BSFException: unable to load language: java

Mon, 2014-03-10 15:39
I was using JMeter to execute BeanShell scripts that I have written and came across this exception. I had to waste sometime to find out what was the exact issue. Although I copied the BSF jar to the JMeter lib directory, it was not sufficient. When I added the bsh-bsf-2.0b4.jar, the script started running successfully. 
I thought someone else might find this tip useful, therefore blogging it.
Categories: FLOSS Project Planets