Search This Blog

Loading...

Saturday, May 1, 2010

The "But Why?!" principle

I have played in the IT field long enough to have an opportunity to develop a cache of anecdotes exemplifying one or the other situation. This is one of my favorites - the "But Why!?" principle:

You could probably accomplish brushing your teeth by pushing your arm and the tooth brush through your back end. But Why?!

Note the intentional imaginary personal pain you would endure while accomplishing such a feat. Any programmer somehow instantly gets the point.

jQuery's jqGrid can now divert row Edit, Add, Delete calls to Local Storage.

What changed in jqGrid:

After an evaluation of jqGrid as a contender for data grid presentation widget, some month ago, I complained about jqGrid's inability to reroute "Edit" "Add" "Del" row calls to local functions. All calls were hardwired directly into jQuery.ajax() call. Since this commit, not anymore ...
Latest code in GitHub now is patched to support rerouting of the Edit (Add and Edit) and Del (Del) calls to a function that takes the same old ajaxOptions object, with all its callbacks. This effectively allows all "useful" data manipulation for jqGrid to be offloaded to a local, in-browser resource, like "Local Storage" 'Data Store / Proxy' function or some other structure that abstracts the underlaying data source from jqGrid.

How to use the new feature:

Same example as before - http://www.accentsolution.com/static/jqgrid_localstore.html
All the magic is in 'testing.js' There is quite a bit of different test code in there, so here are the specific parts that show the diversion of Edit / Delete row calls to a local function (note new dataProxy property):
var divname = 'thegrid', o = jQuery("#"+ divname)
o.jqGrid({
 postData: {
  "filterrules": {"groupOp":"AND","rules":[
   {"field":"data.note","op":"cn","data":"note"}
  ]},
  "viewid": "someview"
 },
 datatype: postdatareroute, // this is repackaged and feed to dataproxyfn.
 dataProxy: dataproxyfn,
 dataStore: sampleDataStore.DataStore(),
 colModel :[
  {name:'data.invid', label:'Inv ID', sortable:true, search:true, editable: false},
  {name:'data.amount', label:'Amount', sortable:true, sorttype: 'float', search:true, editable: true, edittype:'text',
   width:80, align:'right', formatter:'currency', formatoptions:{decimalSeparator:",", thousandsSeparator: ".", decimalPlaces: 2, prefix: "$ "}},
  {name:'data.taxable', label:'Apply Tax', sortable:true, search:true, editable: true, edittype:'select',
   editoptions:{value:{'yes':'Yes','no':'No'}}, stype:'select'},
  {name:'data.note', label:'Note', sortable:true, search:true, editable: true, edittype:'text', width:150 }
 ],
 jsonReader : {
  page: "currpage",
  total: "totalpages",
  records: "recordcount",
  repeatitems: false,
  root: "records",
  cell: "data",
  id: "id"
  },
 caption: 'Sample grid',
 sortable: true, // this allows column reordering.
 pager: '#pagerfor'+divname,
 gridview: true, // Accelleration of rendering. Disables some rendering modes.
 autowidth: true,
 height: 'auto',
 rowNum: 10,
 hoverrows: false,
 multiselect: true,
 multiboxonly: true,
 rowList: [10,30,50],
 sortorder: 'desc',
 viewrecords: true
});
Setting dataProxy parameter is really all you need to divert the Add, Edit, Delete calls from $.ajax() to you custom fn. (Note, by default diversion is OFF. You either have to pass a right setting to the edit call or just omit 'editurl' and 'url' settings from your grid to have all calls rerouted to your function.)
Function behind dataProxy takes 2 arguments. 3 If you include this object:
function dataproxyfn(ajaxOptions, actionid)
What gets sent to dataProxy is something that looks a lot like what gets sent to the function behind datatype, with one exception - we get the whole ajaxOptions object, loaded with 'success', 'error' callbacks.

Yet another article on feeding JSON to jQuery widgets with .Net

Intro:

The subject of feeding JSON from ASP.NET's to jQuery (and other ajax toolkits in general) has been discussed to death on the net in separate micro-focus installments. What I have not seen is the complete discussion of the entire .Net > JSON > jQuery.ajax stack. This article will help you and me wade through the choices and nuances. (in other, more direct words, here i document my conclusions and recommendations, not questions or uncertainty.)
Let's start with the chart of the data flow stack. It has some "choices" still on it, unpruned. The structure of the "request" mechanism is already decided upon - some form of jQuery.ajax-like request that .Net platform would understand. We'll discuss the formatting of the request later. For now, the request flow is not on the chart. The focus is on pushing data out.
.Net - JSON - jQuery widgets stack chart

Explaining the components:

Why .Net?

Negatives:
- the whole MS platform is plain disgusting, from the Frankenstein of the web server which needs another Frankenstein monster (Web Deploy) to maintain without loosing sanity, to lack of reliable non-Windows SQL DB drivers, to myopic stack API design (more on that in the Serializer discussion).

- No "easy" DB ORM. LINQ brings you half way there, but you are still stuck with declaring your DB context and, on occasion, tweaking procs by hand for "write" and "select by item / custom id" functionality. (Compare that to SQL Soup ORM (part of SQL Alchemy) on Python - automatic, run-time, on-demand schema reflection, intermediate object creation.)
Positives:
Aside from usual "Our competence and infrastructure is already on MS-based stack," there is one very good reason to stick with .Net for feeding data to Web front end. .Net already has a prebuilt infrastructure for exposing data in auto-documenting way: WebService and WCF. With WebService and WCF you concentrate on data, the stack takes care of dressing, protocols, infrastructure.
So, as long as the pain of serializing data from .Net's data source into final product - JSON - is minimized, .Net stack is tolerable for pushing data out.

Why JSON?

That is, why plain, custom-rolled JSON vs XML, or some RPC-like data-feeding structures that tie web widgets to server backend?
- JSON is light.
- In eval'ed form it's native to the browser - no need to have custom protocol parsers / translators.
- Serializer / Deserializer libs are ever-present.
- It allows us to disconnect the front-end web-interface stack from the back-end server stack that supports data-feeding infrastructure. In other words, I can produce same JSON using Python-based Twisted server platform and .Net-based platform. If my data moves to other DB / platform, "data-feeders" move without affecting front-end. If I move front end (from jQuery to ExtJs, for example) I don't have to change "data-feeding" back-end.
- It allows us to disconnect data from metadata and security structures . I plan on injecting auth credentials (hash / ticket / whatever) with each data request. (Page's background is not behind an authentication scheme of any kind. Whole communication stream is behind SSL. This allows me to target dispersed data-feeder, behind-a-reverse-proxy server farms with state management pushed to the browser. Sick and tired of state management and tying it to some off-protocol server-based user management plugin like "basic auth". My user DB belongs in database and programming stack, not in AD or htaccess files.)

Why jQuery?


It has the best, free, matured widget set required to assemble business reporting user interfaces.
- jqGrid - tabular data viewing, filtering, manipulation.
- Flot - charting
- SparkLines - micro-charting
+ sane API, ease of use, lots of other glue code in form of plugins.

Next, I'll take a look at the choices that have to be maid ...

The Server-Side choices:

The question of feeding JSON through .Net stack was discussed a-plenty. Here are the best (in my opinion) parts : orgasmic amount of all kinds of detailthe tip on JSON lexicon for .Net WebServicesdealing with the uber-gotcha of ".d" propertythe JSON serialization choicesa good conversation on JSON serializers.

The short story is: you have choices to make. Just take a look at these if you want to make an educated decision. For the impatient ones, let me make the choice of the "Most pleasant and rewarding .Net-based JSON data feeder" for you:

SQL DB > .Net 3.5 or higher + LINQ > JSON.NET (the one from CodePlex) > WebService infrastructure

Assuming you have the freedom to choose the components, you will come to the same conclusion if you investigate all choices.

Maybe, some day I will discuss in detail the "why not the other components" question. Today I offer a few brief thoughts on going with JSON.NET as serializer:
- bypass all class declaration and population as intermediary for talking to DB. Data flows directly into JSON-like, flexible objects (Arrays, Objects) offered by JSON.NET. You can assemble your JSON directly from intermingled Linq queries.
- Untyped, infinitely nested, dynamic data structures are possible. All objects can be serialized, including anonymous, arrays of dissimilar (missing properties) objects, untyped dictionaries containing other untyped dictionaries of infinite depth.
- No decorators are needed anywhere, unless you want them.
A myopic .Net old-timer may say "what's wrong with strongly-typed, pre-assembled classes?" A JavaScript devotee (or anyone who drank the "dynamic" languages Koolaid) is probably smiling with happiness right now.

The Broswer-Side choices:

In the "why" sections above the question of components was answered. No need to make any choices on "parts." Here we decide on how we allow data to transform and flow.
Important questions:
- all data is coming back to browser as (encoded) text. We need to decide what "decodes" the text into data you need for the data widgets.
- How far away from the consuming widget do we want to put the "filters" and "transformations"? Choices range from "default callbacks for all jQuery.ajax requests" to "make the widget care about direct communication with returned XHR through built-in callbacks."
- How do you feed same data to diverse widgets?

The answers:

Obscure the ugliness of data structure (if any) introduced by .Net, by pushing the transformation functions lower in the XHR response processing stack and keep it separate from data manipulation your front end would do regardless of "data-feeder" stack peculiarities. Feed the data through an in-browser "proxy," "Data Store," an "ORM," an object that takes ajax options object to start with, adopts / applies the returned data to internal cache, demultiplexes auth and meta data and emulates the ajaxOptions callbacks to the widget with preformatted, readily-consumable data.
- By "ugliness" I mean ".d"-nested data structure as returned by .Net WebServices.
- By "pushing ugliness transformation functions deeper and keeping that separate from data consuming functions" I mean get rid of ".d" nesting with jQuery.ajax's options.dataFormat() call back and do the actual useful things on options.success() call back.
- By "Data Store" I mean a custom-built wrapper object with Getter and Setter methods applicable to the data at hand. The "Data Store" I have in mind can be compared to ExtJs's "store" structures, but instead of being tied to the widget, the DataStore is tied to the data source and talks to widget over emulation of .ajax request-response cycle. This way the "interface" (API) for all diverse widgets is same, familiar old one - ajax request. No need to worry about making all widgets talk to same "data API." You do have to worry about being able to divert the calls from jQuery.ajax() to MyNameSpace.ajax-like_funnel().

Example:

Example of diverting ajax requests for jQuery jqGrid widget from $.ajax to a local "funnel" function:

http://www.accentsolution.com/static/jqgrid_localstore.html

See "testing.js" loaded by the page.

The "Data Store" actually talks to and pulls portions of data from a local, in-browser array of data. jqGrid (no custom modifications, using last version from github) has no clue about diversion. All it knows - it talks "ajax" to a functions that works like "ajax."

Coming up:

Examples of code for the same diversion of ajax calls but with .Net WebService data back end. We are going to bypass any and all class declaration / minutia. Just a taste of it for you:
1. DataContext >
2. Linq to JSON (thanks to JSON.NET) >
3. Custom packing of data into UNtyped, loosely-structured J* .Net objects >
4. .toString() >
5. return the "string" with [WebMethod]-decorated method (which will wrap the stringified data into {'d':data}
6. On client-side pick up the string in dataFormat() ajax callback and unwrap {'d':data} into data
7. Call .success() on the unwrapped data (which feeds the answer to data store)
8. Have data store "undress" data (remove meta data) and feed only the needed, pure JSON to the widget.
Finger-licking goodness of a plan.

Thursday, February 25, 2010

jQuery's jqGrid - feeding JSON data from a Web Service

Intro:

In Looking for Perfect Web Toolkit story I mused about a need for a robust web stack that would satisfy a progger insane enough to contemplate a competitor to GitHub's of the world. The order is tall so the primary demand for that magical web stack is one - make the stack do the grunt work.

"Do the grunt work" in today's case means - MVC-like behavior of the JavaScript toolkit.

Idealistic view of such a stack:

1) Very light web-templating system / server serving the frames with JS hooks. (See ASP.Net Master Pages, or some Python-based templating system on top of Twisted as example (this is a hook for future post. Link to follow.).

2) Web Service feeding data and settings as JSON to JS widgets activated by JS hooks. (.Net WebService examples 1, 2, 3, and the most insightful. Python-based Twisted example is coming in a future post. Will add link here.)

3) We stay on the page as long as possible. JS bulds / removes DOM / Modal dialogs for us.

4) "State" is kept within JS client, not on the server. (some cashing of the state is there, but not mandatory, as JS-based auth detects when server thinks auth is out of sync and prompts reauth.)

Practical Example:
Need to present tabular data in a grid... Not any grid, but the one that allows insanely flexible and simple filtering, reordering and resizing of columns, and, hopefully, contextual element edit functionality - entirely in the browser, without postbacks to server to rerender the view / elements or dress the data in a table.

In the race to the top, jQuery's jqGrid won over ExtJs's grids. More on the competition here (link to be added).

Populating jqGrid:

Unlike ExtJs's grids, jqGrid does NOT work off a DataStore of any kind, "Everything" is geared towards the old days - pulling Gets or Posts off various (and I mean VARIOUS / separate) URLs.

This is bad. This fails the vision of a web stack outlined above, where "state" is shifted to JS client. I want to manage "log in" keys with the JS client and have it send the hash on every data request. Injecting authentication credentials becomes pain when your widgets just wants to know the post URL and assembles the AJAX request by itself.

By "everything" I mean:
- Default (non-filtered) data pull.
- Search (filtered) data pull. ()
- Edit (HTTP Post) with consecutive grid reload.

- Default data pull:
Luckily, default data pull allows one to specify either a method argument, or function to run to get the data. This means, if you really want to play with post arguments, you replace the AJAX call and trigger the grid population by hand. This is fine, since this allows me to populate the POST the way I want (the way .Net-based WebService can actually take it)

Example:

function processrequest(postdata) {
jQuery.ajax({
type: "POST",
url: "./dataserver",
data: JSON.stringify(postdata), // we can inject whatever data we want here.
contentType: "application/json; charset=utf-8",
dataType: "json",
// success: function(msg) {alert(msg);}
complete: function(data,stat){
if(stat=="success") {
var o;
o = jQuery("#list")[0]
// note, this example is from a NON-ASP.Net WebService.
// there your data is wrapped into dictionary with only one key - "d"
// You will have to undress data by JSON.parse(data.responseText)['d']
o.addJSONData(JSON.parse(data.responseText));
}
}
});
}

// Declare your jQuery jqGrid:
jQuery("#list").jqGrid({
// url: './dataserver', // you do NOT need this anymore! Yey!
datatype: processrequest, // pointer to you magic data-pulling function
...
})
Example of what server gets:
Content-Type application/json; charset=utf-8
X-Requested-With XMLHttpRequest
Referer http://127.0.0.1/index.html
Content-Length 115

Content: {"_search":false,"nd":1267138960090,"rows":20,"page":1,"sidx":"invid","sord":"desc"}
Good. Getting plain data from a WebService. So, how can we search?

"Toolbar" search is sexy but, breaks horribly when combined with sortable columns, and does not allow you to override the AJAX call. It literally fails when "url" key is not set on the grid.

Advanced and simple search work in very similar ways. A modal dialog pops up. It's built automatically, based on the flags in your flags in Column Model. No extra work required on the part of progger. These two searches use the datetype: value (our magic function) to communicate the searched fields to the server.

Simple search spreads the search args among other properties of the post. However, Advanced method packs all of "filter" args into single key - beauty and pleasure to work with. Moreover, Advanced search keeps track of already set up filters. You toggle the search dialog and all of your search fields are there.

Example of what gets sent:

(POST request headers)
...
Content-Type application/json; charset=utf-8
X-Requested-With XMLHttpRequest
Referer http://127.0.0.1/index.html
Content-Length 184

Content: {"_search":true,"nd":1267139196421,"rows":20,"page":1,"sidx":"invid","sord":"desc","filterV1":"{\"groupOp\":\"AND\",\"rules\":[{\"field\":\"amount\",\"op\":\"eq\",\"data\":\"100\"}]}"}

Good. We choose Advanced Search and 2 out of 3 items can be fed by the same WebService. What about built-in editing of the items? This is where we hit the brick wall. All that Editing code asks from us is "Gime the URL i would post whatever I decide." If you don't define editurl property on the grid, editing code complains.

Short for rewriting the code that in non-minified version sits in grid.formedit.js (see lines with $.ajax, there are 2 of them ) there is no easy, practical way make edit POST JSON in a WebService compatible way.

Conclusion:

It's possible, with very little effort to push JSON from a WebService into jQuery's jqGrid. Very easy. But, that applied only to environments where you don't need to edit the data you see in the grid - just pull and filter it.

Dontcha worry. I'll make it work for editing too.

Friday, February 12, 2010

Automatically expanding HTML textarea.

Intro

It's very likely that no self-respecting JavaScript coder can pass an opportunity to write a templating system that converts some JSON object into a tree of DOM elements. I am not a JavaScript coder, but the idea just sounded fun and useful for grasping the deeper understanding of browser DOM element creating fundamentals.

Found quite a few very good sources of tips for the templating / DOM-creating endeavors, but will note those in a later post. Today, we go more fundamental than that - HTML's textarea element.

I gave up caring about which data elements are single-line and which could go multi-line on me at any moment, and are just preparing for multi-line-capable UI from the get go.

What every self-respecting multi-line-text-entry-capable UI needs is an auto-resizing textarea object.

The Goods

There are many many implementations of various levels of readiness, but the most robust ones appear to be the ones using a hidden div for calculation of area occupied by text. Some of you may think "What's the bid deal? Count the number of carriage returns..." and you would miss the biggest point of modern textarea - ability to wrap long strings.

Long story short, if you are on jQuery wagon, seriously consider jQuery-Elastic.

It's MIT-licensed - same as jQuery, and is mature.

It works well with proportional layout. I like sizing the wrapping div and have input elements at "width:100%". jQuery-Elastic handled that just fine.

There are no funky CSS settings / files needed. The CSS arguments that Elastic clones from the textarea into the off-screen div are a perfect set to withstand even browser-based scaling. (Scaling worked perfectly in FF. IE and Chrome caused the height estimate to overshoot just a tad and the textarea was growing some 25%-60% of an extra line of hanging empty space on the bottom.

If you take away the dressing, it's about 20 lines of cross-browser-compatible (IE8, Chrome 3.x, FireFox 3.x) code that does the job rather well.

The call-back is tied to keyup event and enabling the chosen textarea elements for "elasticity" is as easy as:
$('.elastictextclass').elastic();
I did have to make some alterations to the stock plug in:
- For compatibility reasons, the default code keeps a hanging empty line below the text. I removed the line. Now, textarea looks like input type=text asdf - very nice for inclusion into long forms.
- Added hookups into existing keyup processing code to handle "exiting" from textarea through CTRL+ENTER.

Adding alterations was easy - another sign of quality of the code.

jQuery-Elastic - highly recommend.

Wednesday, February 3, 2010

Looking for perfect web toolkit. Problem definition

Intro

This is what prompted the search for the perfect web platform:

It's January of 2010. I have been drinking the Git KoolAid for almost a year now rather intensively. Thing is, in my organization (.Net, Windows shop) it was just me doing it (over Cygwin). I wanted to share the goodness of Git with coworkers.

The problem is that for closed-source, Windows-based shops there is not that much goodness to be had. There is just mediocre here and there. And, then, there is just plain appalling when it comes to internally-deployable web interfaces that manage team access to the Git-based repos.

There are some present internally-deployable web-based shells for repo / user management, where Gitorious is the best example, but, like all gems and rubies go, there are always rough edges. In case of Gitorious (circa Jan 2010) it was the "it runs at root of the domain." Other web-based front-ends are just too subpar to even consider.

So, the problem is...

No off-the-shelf, internally-deployable software that could offer the functionality of GitHub (Easy project with multiple repo creation, cloning, adding people to the group of authorized comitters) and, hopefully be of non-monolithic construction, so that we could plug in things like asynchronous messaging (XMPP, Stomp etc), live chat (think team collaboration and user support) over Comet (aka reverse AJAX, aka Server Push), 3rd party software and Web2.0 services.

Saturday, August 18, 2007

Bypassing Charter Pipeline's hijacked DNS helper

The Problem:

Urg! Demn annoying penny-pinching ISPs!

First it was Verisign, than Earthlink, than Charter, than Microsoft. I so hate seeing this:

Instead of this:
Note, in both cases the same misspelled address was typed in - mapsS.google.com. In 1st case, Charter Communication's default DNS server was used, in the 2nd case, their undisclosed master DNS server was used.

In first case, every time I mistype a domain name (in SSH, PING, or browser's address field) I get a valid DNS A record given to me, which freezes PING and SSH and produces trash in browser's address field.

In second case, same mistyped address gives a valid "server not found" code and all my applications behave normally.

Here are the NORMALLY WORKING Charter Communication's DNS servers:

209.225.8.42
209.225.8.43

These are their master DNS servers that DO NOT return "Charter Communications" "Sorry, the page you are looking for cannot be found." But how do we use them instead of the SiteFinder / Wildcard

Regular Charter Communications's Pipeline customers are on DHCP connections and the IP changes every time the modem reboots. So, there is really no practical way to set just the DNS servers manually in the router /computer set up screen, while keeping IP on DHCP.

If you want to call and complain to Charter about this, you better prepare to use the lingo. Start with this blog on dslreports.com and collect the ammunition. However, since people were complaining about this since February 2007, and nothing happened, don't hold your breath...

The Solution:


For those behind a good router, you can keep the WAN side as DHCP, and set your internal LAN network to static IPs. This way you can override the DNS servers on the machines themselves.

Those with screwey routers, who cannot do static MAC-based IP assignment on the LAN side, you guys are in for a ride.

Windows machines only support manual IP AND DNS or static IP AND DNS. There is no easy way to Have IP assigned by DHCP and DNS hand-chosen. But, on Linux you can have the best of both worlds.

If you use NetworkManager in Kubuntu or Suse, and prefer to get IP over DHCP, you can still go inside "Manual Configuration..." menu option of KNetworkManager menu and prescribe your own DNS server IPs. The bonus here is that you can store that as a profile, and set your preferred DNS servers back with one click. Observe:


Once you remove the broken crap and enter the properly working 209.225.8.42 and 209.225.8.43 DNS servers, go to Network Profiles tab and save it. Next time your DHCP server sets your servers to Charter CrapSiteFinder-producing DNS servers, go to the same tab and activate the saved profile.

Now, pick up your phone and call Charter with a complain.

Charter Corporate Complaint Line: 314-288-3150

Tuesday, January 9, 2007

So, you want to contribute to KDE's Oxygen project...

Why Oxygen project is like a strip club.

Oxygen team is a group of people with long history and plenty of skill in art-content creation. Normally you don't argue with the artist – it's art after all... But, Oxygen icon set is not just art – it's a working part of user interface. In my book, before an icon is allowed to be fashionable, it must be functional.

While marveling at the quality of drawing skill, I couldn't help but notice small problems here and there. To an untrained eye Oxygen project appears to be open-source-flavored, so I tried to “contribute” with tweaked images and “bug reports,” to be met with an unusual amount of “why-don't-you-buzz-off.”

Why don't you buzz off” is a normal and reasonable part of major developers' tool set, but, this time, i came carrying gifts, and got a boot almost immediately. Altered icons were calmly put on the shelf, serious written suggestions were met with childish jabs, childish whining was met with parental reprimands... I was intrigued... The behavior did not fit the usual “open source project” pattern.

And then I understood: I could look, but I cannot touch!


Why touching the raw body is important in Open Source world.

You are making a cake with your favorite strawberry filling. By mistake you forget to add thickener to the filling. After baking, you cut the cake and serve it to your friends. The pieces are gooey mess and you are forced to cover it up with whipped cream, because baking a completely new cake is just not worth it. That thing you covered with whipped cream happens to be “good enough.” tm

I never baked a cake, but ate enough half-baked solutions to notice one in the making. If I point out few things to the baker, while the cake is still in the making – it takes seconds to fix it. If comments and alterations to the publicly consumed product are only allowed after it is already in the stable branch and has a string-freeze on it – you have to be God or someone very similar to enact any change.

By this time many of you clever people will get what I am saying and will argue that only contributors with “merit” are allowed to advise. You want to be listened to – earn merit.

This is where the Oxygen project comes back into our story...


When does “your open source project” stop being yours?

Edited log of a conversation from #kde-artists circa January 8, 2007. To the best of my knowledge, “kwwii” is Kenneth Wimer's nick. Kenneth is one of the people working on Oxygen team.


CuCullin: back to my licensing question :) In general, should other artwork generally fall under the Free Art License (seemingly compatible for any work that is not specifically "software or focumentation", but recommended over CC2.0?
CuCullin: the fsf recommends the free art license over cc, and the eff lists the free art license - other than that and CC, I couldn't find any existing alternatives
kwwii: that cannot work for us, as we will dual license it probalby
kwwii: so that we can also get jobs working for companies after "finishing" oxygen
CuCullin: why wouldnt the gpl equiv for art be the "official" kde artwork license, and companies can go ahead and license whatever they want for unofficial kde artwork goodies?
kwwii: well, that is exactly our plan
CuCullin: as in, upstream contributed artwork being free.
kwwii: exactly
CuCullin: so all kde artwork is to be dual licensed, in a free way, and then the ability to have a non-free way?
kwwii: not all artwork, just some of it
kwwii: well, some licenses prevent dual licensing
kwwii: IANAL so I get scared and freaky whenever I even think about this stuff
CuCullin: i understand that - but why would "official" kde artwork have to be dual licensed, thats what im not getting. KDE is only covered under one, why is the artwork different?
kwwii: well, if oxygen is the official artwork, which it will be, we (the orginal authors, the authors of some of it) need to be able to dual license it so that companies give us jobs
kwwii: eating and paying the rent is important for me
kwwii: certain companies will hopefully pay us to work on oxygen for them
kwwii: so the stuff that goes upstream is free but the stuff that we do for them is not

That is not exactly bad news or illicit behavior, but, rather a simple explanation for why it is so difficult to contribute to Oxygen at this time. Right there lies the reason why people trying to join or, at least help, with the building of the better tomorrow are getting shot at.

If “original creators” share the “original creator / contributor to Oxygen theme” title with all people who want to improve the theme, that will dilute their monopoly to license “KDE's official look” to commercial products. If KDE's official Oxygen set is provided under a more restrictive license, similar to GPL, only Oxygen team will be able to sell commercial icons incorporating official KDE design elements. If Adobe wants its closed source Acrobat Pro to look like KDE, there is only one shop that could do the icon job.

My mom says: “There could only be one woman controlling the kitchen.” But what is being cooked here is much more than a single meal, but the insignia and feel of the whole project. Ready involvement of “junior contributors” would ensure a splendidly attuned dinner and guarantee of further propagation of the style. Instead, free lunch is offered with a side dish of glass sealing.

Small-time / aspiring artists will have to wait till official Oxygen set is released under a license that allows distribution of modifications.

Be nice to your grandkids, who else will chew your food for you when you loose your teeth.

I see more KDE power and community on KDE-Look than on kde.org. I see KDE survive Gnomization of commercial product arena only through its “accepting” community. KDE was the place of a dozen text editors, competing rather freely.

In the last year, I saw kde-promo and artwork teams completely fold under organizational umbrella and internalize the contributions. At last Akademy Aaron Seigo is said to ask the audience, “What is KDE?” I am told, as an answer he showed the audience their own photos. I hope that did not get into lead hackers' heads in a wrong way.

Monday, October 30, 2006

Getting chat bubbles back into Kopete

With version 0.12.x Kopete lost my favorite chat style - iChat. It's for a good reason - that look might have been "encumbered." But, I need a simple, personal chat style; so I got it back.


Kopete users, meet "Bubbliki" - the not so new, but, fresh and Adium-compatible Kopete chat style.

Bubbliki normally shows
  • logo of you and the chat partner
  • message bubble (consecutive messages get into the previous bubble)
  • status messages (in gray, and not in bubbles)
Six different color combinations are provided for the bubbles. You can choose your own color, but will have to edit [variant].css to get it in. When you hover your mouse over the logo, the name shows up. When you hover over the individial message, the time for that message shows up. Observe:

You can get Bubbliki chat theme here on kde-look.org.

Thursday, October 19, 2006

How to Protect Your Open Source Project From Poisonous Yourself

There are these pesky, annoying new users that float around the Open Source. They suck your energy, bog you down with endless arguments and make you loose your focus... Maybe for a good reason.

New Approaches to Cockroaches

How to Protect Your Open Source Project From Poisonous People (PDF) by Ben Collins-Sussman & Brian W. Fitzpatrick is the new solution to the old problem - How do you keep dissenting and free-willing element out of your cult.

Inquisition burned and tortured. Southern whites strung to the tree and lynched. Communists summarily ... The new approach - smile and stare at the unwanted blindly until he gets tired of banging his/her head against the wall and goes away.

Attention & Focus: are They Worth Guarding?

There are 2 kinds of open source contributors:
  1. - wobbly, innocent ones:
    • "Undecided"
    • "Well, I am here somehow, might as well become usefull"
    • "I am here for the company"
    • "I use it and feel the urge to give back"
    • "I am doing it in large part to make the world a better place."
  2. - all the others, including:
    • I am doing it to leave my mark / legacy in this world.
    • It scratches my particular itch
    • I am coding because that's the only thing I can do.
    • I am doing it to get a line on my resume
    • I need to have a hobby, a pet-project I would care for.
    • I, I, I, me, me, me
Not surprisingly, the group 2 is usually the core of the cults. They have the focus and attention - they have a clear goal in their head. They are the ones who usually are the actual poison.

When leaders sit in the chair for a long time, myopia creeps in. What may look like outlandish, baseless whining, could actually be the first sign that the rest of the world will soon give up on you and move on.

Let other people audit your focus vocally, on a regular basis. If you are too protective and controlling of your focus and project, you are insulating it from new blood, ideas and vital course corrections. Screaming matches are a waste of everyone's time, but a sturn argument is your best friend. Being wrong just for the hack of it on a regular basis may be the healthiest thing for you and your hobby.

"Whaaaaaaaa-aat? Me bend to requestests?! That's unpossible!"

In short, be very careful using the Poisonous Person ideology. The whole premis of the "How to Protect Your Open Source Project from Poisonous People" presentation lies on a fallacy - in practical, long-term view "Your" and "Open Source Project" cannot be used together, unless you want your ego to be kicked repeatedly in the groin, or you want the project to die.
Annoying, demanding whiners are not the poison, they are a vaccine. The deadly poison is the words "I, Me, Mine!"

Friday, September 22, 2006

My god! What have they done to Windows UI?!

DISCLOSURE:

I like Windows OS, I like it very much. On it, you get things done. It is a platform of choice for generations of people who needed "open-ended" (as in: Very easy to develop on.) and "standard" (as in: Monopoly means - the platform is pervasive and uniform - a good thing in my book.)
Windows (XP in particular) added immence convenience to the platfom in the form of quick hibernation (to disk - a laptop must), solid wireless connection control module. On my laptop, I manage to work in MS Office with my hard-drive and fans completely spinned down. Unlike Linux+KDE on the same machine, it is completely silent when it matters. Love that. For 2 years now I was really trying to make Slackware / OpenSuSE spin down its drive when it's idle to no avail. There is always some app / service that wants to wake my drive up and cause its untimely death.
So, while my heart belongs to Linux+KDE, my brains and outmost recommendation solidly belong to Windows.

THE POINT:

So, why does Microsoft goes around and pokes a stick in users' eyes with the new UI skin and the monstrocity of inconsistent UI element arrangements? Horror!
For 2 years I was secretly hoping they would come down to their sances... This is several magnitudes more horrible than the Keramik theme debacle on KDE. MS added insut to ingury by allowing programmers to turn window UI into butons / elements salad.
In Windows XP I could always switch off, or change the Luna into something more sensible. There is no escape from the designer's poor judgement now. Uggghh...

Tuesday, June 13, 2006

Guilty pleasures of KDE

THE SIMPLE PLEASURES OF THE PRESENT


One can easily overlook the complex things and be completely stunned with the simple.

I was scouting for “best” SuperKaramba applets while working on the KDE 3.5.x screenshots and I was stunned by the simplicity and genius of a-foto – a SuperKaramba applet. It is designed for only one thing – show miniatures of your favorite photos on your desktop. The genius of the applet was in it method of use – you drop the items you want displayed on top of the applet, and in its exquisite picture frames.




THE PROBLEMS

I also realized how much little gems like a-foto need our help to make them diamonds. Looking at the many things Open Source world have produced, I see two things that consistently make good software languish and sink bellow the surface of visibility:

1. Obscurity.

This is the deadliest disease in Open Source. No matter how good your software is, if people don't know about it, it does not exist. It is a “If tree falls and no one is around to hear it, does it make a sound?” kind of a thing, but with a twist. There are so many big trees falling around, we miss the small trees behind the noise. It seems, there is only one way to promote small, but genius projects – organize “fallen tree” support groups and really, really yell about it. :) Hence, this 1st column on the theme of “The gems of KDE.”

2. One-sidedness of author's skills.

This is not a deadly affliction, but a very annoying one, like herpes. It puts a sealing at how popular your software can become.

In the case of a-foto, one-sidedness was manifested through natural limits of how well a beginner-Python-eer, graphics-designer-type can do a “mainstream” applet. As was said, visually and conceptually the applet was stunning, but mechanically it was a stretch. It had some ineffective redraw issues and mildly suffered from ESL-ism (English as a Second Language). The author did it's best in the area of his expertise, scratched his itch and more. Yet, he would be would be clobbered by demanding users would he try to push the applet further. Hence – it languished in the depths of kde-look.

There in lies the problem – if platform does not offer a safety net for its gems – it's platform's loss. Foundation is only as good, as the things you build and use on top of it. KDE has promoted its steel frame through and through, but forgot to mention that we also have excellent decorative, quality-of-life elements in our present building. Structural solidity is often a given now-days. Finishing touches, and their availability today counts a lot and conveys the “readiness” of the platform. Luxuries – is what seals the deal. In the end, any platform is there to be used, not continuously rebuilt. I want to see and hear about whatever the luxury, glamor and posh-ness of KDE there is today.

WHAT CAN BE DONE

No matter how highly people think about Open Source, in the core, it IS a meritocracy – a democracy in which some voices have disproportionately high weights. The more you contribute, the less inquisitive eyes are pointed towards your opinion. It's not that everyone suddenly starts to trust your opinion. It's rather - “Ehhh, I'm ganna let it slide and not complain. He does good on average.” The key to pushing your own agenda is to do a lot of what public wants and likes, and the masses will forgive you little personal pet projects you push through the public forum. If you do promoting out of real goodness of the heart, the masses may even listen.

Advertising 3rd party projects is a bit controversial. It involves taking sides – ugh! But, replacing respected opinion-ism with respectful silence is death for everything you stand for. I stand for quality of life, even while traveling to a better place. They say “cold fusion is always 5 years away,” so was the “true communist society.” The truth is, constantly living in transitional state and thinking about better future is bad for mental health.

In Soviet Union, people would always be told about better, stable, more advanced, heaven-like places (Black sea coast, Moscow) and rely on these rare “complete” pleasures for relief from drag of leaving on the “road” to better future for the larger remaining part of the year.

I want to hear about “semi-officially recognized,” better, stable, complete, more advanced, heaven-like places that are available on KDE today. If no one sees real examples of KDE luxury accessible today, there may be a real turnover issue with the volunteer work-force that builds the road to KDE's better future. (Minister of “Information about present day goodness” anyone? :) )

1. I would like those whose voice is loud to scan regularly and systematically the area of your interest and subjectively pick a project needing attention and plugging it, broker for devs to help with parts you consider missing, all in the name of preserving the few mandatory luxuries of KDE's “today” living.

2. I would like people to be critical and take sides. It is harsh, but greatly helps the newly-arrived and the currently dis-illusioned. You tell them straight what is the best item in the box. I am talking about “Kaffeine is much friendlier and feature-full than Kmplayer,” “Kontact is good looking but brings very little to the table in terms of Outlook-like integration between components” and “For a generic user DigiKam is the most complete solution.” Harsh and subjective, but user can rely on it.

EXAMPLE

I used my 15 minutes at the pulpit to plug the best “generic” reality of lushness of KDE in the KDE 3.5.x screenshot series. I rubbed the established norms against the grain a bit, by deviating from “default” look and application set. The result – a much more complete, useful promotional message. I am glad I got away with the little changes to the decor, and pet projects (basket, a-foto, miloCalendar), and taking of sides (Kaffeine, Twinkle). In the end, if more “user” types will raise their opinion, the overall message maybe not as controversial or diverse as originally thought.

So, how can we tell a better tale of "today's" KDE?

Wednesday, January 11, 2006

New skin for YaKuake

Just posted a new Plastik-inspired skin for YaKuake. More info here.


Wednesday, December 14, 2005

Video and TV Out in Xorg on Linux

SUMMARY:
Current approaches to (a) enabling / managing TV-out on ATI's video cards and (b) ways of enabling / managing Xvideo (video overlay) assignment on a running X server. I introduce ATI's aticonfig utility as the main part of the solution. (see end of article)

(2nd Edition. Seems many people found this article useful. I edited for simplicity of consumption)
(addition: I made a simple SuperKaramba applet for XVideo switching.)

PREFACE:
Unlike what many ppl think, TV-out (linux, windows, etc) has 2 different meanings.
To normal folk, TV-out from a computer means, you can see your computer screen picture on TV, similar to hooking up a laptop to a projector for business presentation. To folk like me, who play with video streams on their computers and would like to push it to the TV, TV-out immediately collects one more layer of complexity. We are talking about management of video overlay.

Video (I am talking about, good-looking, non-flickering, perfect picture) is a special citizen in computer world. That perfect kind of video picture you expect from a DVD movie is treated as special stream by computer and gets a special - direct - way from the decoder into a "back door" on the video card and onto the screen. So, while the rest of the picture of your regular computer screen goes through compositing, waits in line and finally gets to the screen, the video feed can swoosh through the time-space continuum and be simply glued on top of the picture right before it comes out of the video card. That is what's called video overlay, or Xv in X window world. (Xv is not the only kind of overlay on X, but it's the most commonly supported by drivers and media frameworks. See the end of the article for OpenGL overlay discussion)

Why is this important? Normally, this "hardware accelerated" video overlay can only be pushed out of only one output of video card. This problem is often described as "The video shows on one screen, but there is only black/blue/pink square on the other screen." ATI's windows drivers learned to multiply Video Overlay. On Windows XP, my Radeon's drivers allowed me to clone Video Overlay to all the screens at the same time. On Linux though... you know. Now you should understand what my problem is...

THE PROBLEM WE ARE SOLVING:
I have a TV card in my Slackware box that I use to record fun TV programs like "South Park," "Family Guy," "Lost." Luckly, my wife is not into "South Park," or "Family Guy" so I just watch these on my computer screen. (I use KDE's Kaffeine player frontend for Xine, with Xv as output standard.) Unfortunately, "Lost" is her thing and she wants to watch it on a 34+ inch TV. I don't blame her, the TV comes with a sofa parked somewhat in front of it. So...

I want a TV-out that is easy to enable and (most importantly) can output Xv on demand! I don't want the TV resolution to dictate what refresh rate and screen size I have on main monitor. I don't want to run a separate X server (extra resources used) to be able to output Xv onto it instantaneously (i.e. without restarting X).
I want to work / use Xv on main monitor, turn TV on, switch the video stream to it, watch a movie on TV using same Xv extension, return back to my computer screen to work / watch movies through Xv on computer monitor, all without restarting X.
You may say, "Whattsa matter wit you? You can do it already..." Not quite. With Xv in the mix, on Linux this is an uphill battle.

SOLUTIONS:

There are 3 ways I can potentially go with my ATI Radeon 8500 (SVGA, DVI and S-Video out.):
A. Xorg drivers, or B. Xorg drivers sprinkled by Gatos project, or C. ATI proprietary drivers (fglrx).

A. Xorg drivers (6.8.2 and 6.9, 7.0):
The Xorg's "radeon" driver has NO obvious, listed options for enabling or controlling the TV-out. There are numerous messages on the xorg mailing list saying that radeon driver does not know how to activate the TV encoder chip. As a result, simply defining the S-Video out as one more monitor only produces garbage on TV screen. The latter is confirmed by other messages on the same list.
For some, the problem with "stock" Xorg drivers (its inability to activate the TV-out encoder chip) could be mitigated by a utility called atitvout. It is designed to make direct calls to the video card BIOS. In my case, the calls were unanswered. TV-out not yet.

B. Xorg + Gatos:
I red the TV out documentation on Gatos web site and am a bit scared. The instructions talk of patching the X sources, compiling them, compiling additional software, etc. At the same time, there is very little mentioned about what and where I can do on Xv front. Does it come out on both screens? If not, how easy is it to switch screens? (see xvattr link for that)
Without those answers and influenced even more by the statement of immaturity of the solution, the unhappy prospect of recompiling X and other funkiness, I decided to postpone the discovery of Gatos until some better days. Besides, some Gatos parts are moving into Xorg 7.0. Once they are well documented, I'll look into this again.
In the meantime, those who dare to go this route should find these resources useful:
"TV output module" page of Gatos project.
A non-ATI utility for switching the screen for video overlay. Example usage: xvattr --attribute XV_SWITCHCRT -v [0/1]

C. ATI's proprietary fglrx drivers:

There were huge problems with using ATI's drivers
  • No Composite support; (per 8.24.8 release notes)
  • No (reliable) support for software-suspend / hibernation; (per 8.24.8 release notes)
  • No support for ACPI. (The drivers expect APM.) (per personal experience)
  • - No TV out support on ATI's X1xxx cards yet. (per 8.24.8 release notes)
There are huge pluses as well:
Well, the OpenGL for starters. Also, hands down, ATI's fglrx drivers offer best documented and easiest ways to enable and control TV-Out. I don't need to set up any new monitor section. I don't have to change ANY of the settings in the xorg.conf. If the card detects a TV connected to the S-Video or composite/Yellow RCA connector, TV out is activated automatically when X starts. You can even leave "Option 'DesktopSetup' '(none)'" in place. All you really have to change is the TV signal standard, if the default "NTSC-M" is not for you.
The excellent part of the ATI's tv-out is that TV is on, even when my main monitor's resolution and refresh rate are well above those of a TV. In this mode, TV simply "pans" (Imagine looking at a picture with a magnifying glass.) Even cooler part of this set up is that (my) ATI's TV encoder chip accepts 800x600 resolution as acceptable. It then scales it down to TV's 320x280 interlaced (or, whatever that is), producing unquestionably exceptional (for TV) picture.

Managing Xv on a running X server:

The docs also make it clear that I can output Xv to only one out at a time. In my search for a simple way to switch which screen gets the Video Overlay I found - aticonfig.
ATI ships an "aticonfig" command line utility with it's drivers. It is designed for changing the xorg.conf through command line arguments. One of them is "--overlay-on=" option, which targets "Option 'OverlayOnCRTC2' 'n'" but affects the running X server as well. Bingo!
This command ("aticonfig --overlay-on="[0/1]) can switch a running Xv video stream from one screen to another in mid-air.
I can watch a movie on computer screen, pause it, run "aticonfig --ovon=1", turn TV on, say to my wife "You have to see this" and hit play to continue watching the movie on TV. (A tear is crawling out of my eye.) It's a miracle!

IS THERE ANOTHER WAY? aka. How to get video stream on BOTH, the computer and TV screens?:
All that XVideo talk I had above is nice. But, what if you need you video stream to be cloned to many monitors? Then, we need to look into a completely different type of video overlay - OpenGL overlay.

To make it work, you don't even have to touch the Xorg.conf. As long as OpenGL works on your system, you have a chance to use OpenGL "video" overlay. To enable it, you go to your favorite video player and change the video output driver setting.
In my case, it's KDE's excellent Kaffeine media player v.0.8, that uses Xine media engine. If the setting (see screenshot) is accepted by Xine (Kaffeine will let you know if not), you will instantly be able to output video to all cloned screens.



So, why all the hoopla about XVideo above? Why NOT just use OpenGL overlay? Two reasons:
- Not everybody on Linux has a working OpenGL. Direct rendering / OpenGL brakes hibernation on many platforms too. So, on my laptop accelerated OpenGL is completely disabled.
- XVideo uses much, much, much fewer CPU resources. On my 933Mhz Pentium III, Radeon 8500 computer, OpenGL overlay consumes 100% of CPU, makes the rest of the system jerky and drops video frames fairly often. Playing a DVD through XVideo, scaled up to 1280x1024, with some extra effects, only consumes about 30% of CPU.

Saturday, December 3, 2005

From 0 to Kubuntu in 1 day.

How I installed Kubuntu Linux on a laptop with NO cdrom or floppy drive.

WHY LINUX ON MY LAPTOP?

Wanted to install a Linux on my laptop for 3 reasons:
- the CRT on my Slackware desktop is killing my eyes;
- the whine of 3 hard drives (everything else I silenced as much as I could) was getting on my nerves and
- wanted to work on computer while lying in bed.

I am otherwise perfectly happy with only Windows XP on the laptop, but it makes it difficult to work on things like SuperKaramba applets, use Kopete or Kmail. I also want finally to get around to coding a small server-client command-line app for timeshifting/recording TV using the MPEG2-encoder/tuner on my desktop. Since that will likely be in C (which I am yet to learn) and will use Linux pipes, windows as a development platform was too difficult to digest. (I could also VPN, or NX to the Slackware box, but...)

CHOOSING THE DISTRO

1. "Just say no to RPM."
I consider my experience with RedHat version 5.x to 6.x a traumatic experience. If someone chose to plunge into what is commonly known as "RPM Hell" that was the right time and I was the person. Since then, the word "RPM" induces the same violin screeching noises one would hear in the "Psycho"s bathroom scene. I am afraid I will brake the screen if I see words "rpm" and "required dependencies" in same sentence.
Loosers: RedHat, Mandriva, (with great pain in my heart) Suse)

2. "Not Gnome-centric distro"
I see only one problem with Gnome as a central theme of the distro. KDE there Is usually poorly integrated and horribly put together. One example of that is KDE on Ubuntu (tried some time in beginning of 2005).
Loosers: (Fedora, Ubuntu)

3. "I want a working HAL"
I got tired of recompiling KDEBase to include HAL/DBUS on Slackware everytime I download new version of KDE. It is not difficult, but, very annoying.
Loosers: The only looser is my dear Slackware. (and, maybe Debian)

4. "I want to be in with the crowd"
It has to be a major distro. I want to see any bug I discover to ba already discussed and, possibly, solved on the forums by the time I am ready to post about it. In other words, I want biggest quality control crowd.
Loosers: all the relatively small, specialty distros.
5. "I want it to compile"
I want a distro that has relatively generic, not heavily altered libraries. In case you are wandering whoever tried the Linux distro Corel made once - that was I. In case you are wandering how long it lasted; it lasted until I tried to compile some generic KDE app against their heavily altered KDE sources.
Loosers: Linspire, and that other one, you know what I mean. (Slackware is Heaven in that respect)

6. "Hibernate!"
For heaven's sake! Please, let it hibernate (suspend2disk) without problems and my tweaking of it! (Now you know why letting SuSE rot was so painful of a decision)

7. "The Magician"
I want a distro that can install without significant pain on a laptop (Intel 815-based Sony) WITHOUT a cdrom drive or a floppy drive. For that, it has to have boot images able to do a network install. I would shrink windows partition myself. Install windows version of Grub. Get boot images and feed them to Grub. But, then, the disto is on its own.

Once I emerged from this maze, the only (very hesitant) answer was - Kubuntu.

THE DIRTY DEED

Shrinking the Windows partition. I am so glad I didn't have to do it. When I installed windows there I created 2 partitions for system and data. Today, this paid off.

Getting grub to install on Windows. Grub for DOS does not (and will never) work on NTFS partition with WinXP SP2 and up. As a result, the developer is dropping NTFS partition support altogether. Grub for Windows (WinGrub) interface is coo-coo. Until the day I tried to use WinGrub, I thought I can read English. Upparently, I can't. I don't know what I did, but after some error messages, and debacles, I found out that Grub was installed. Yes!!!!!

Getting images for Kubuntu network install is easy, they are on the CD I downloaded. What is not easy is to swallow the definition of network install per Kubuntu. Official word is - I need some special type of ftp set up on server, add dhcp server and make sure the laptop boots from that, and not DHCP server my router provides. Compared to that, going and spending $100+ on external USB CDROM looked much less painful, yet, I decided to see what happens with Kubuntu boot images when they DON'T find everything listed. That was a good move...

The laptop booted the Grub, Kubuntu install boot images, and after some prompts (one of which let me know that my Lan card was detected) I got to a screen that asked to add a source of a Kubuntu mirror. Yey! I saw the light at the end of the tunnel... a very long tunnel as I found out. Yet, FTP install with Kubuntu is possible.

Several prompts further (one of which complained that install cannot alter Grub settings on (NTFS) drive), install informed me that it's going to download/install. It finished that in several minutes... which struck me as odd. My connection is only 5 times faster than a modem, that can't be it. And, it wasn't.

What I got installed was just the base libs, system execs, config files and vi. (the official text editor of people who like doing thing in the most absurd, dificult way, like brushing their teeth by pushing the arm through their ass.) Because of this, I couldn't add "Universe" tree of packages to my APT sources until I managed to run KWord. For the sake of people like me, I wish Midnight Commander would become a standard part of base install. Why, oh, why does it have to be in the (optional) Universe tree?

Well, I sorta know my way around APT, and found APTASTIC (or whatever its name is) by accident. Eventually I clawed my way up. My only wish there was a "whole-damn-functioning-system-with-all-usual-kde-parts" simulated package that I could just APT and go have a lunch. Instead, I had to list'n'apt hoping the dependencies will be drugged in. (Somehow I ended up with Emacs installed, but not Juk, or Kpackage. I feel RPM-Hell-like induced hysteria is creeping in)

Nevertheless, the pain of installation is behind me. Hibernate (suspend to disk), wireless card, and many other things still don't work, but I'm happy I can post this story from it already.

In the retrospect

May be I should have spent some money on a shrink to help me get over the RPM phobia and installed OpenSuse instead. But, I think I had enough install excitement this month.

EDIT:

Several days later, I did install OpenSuse. It was suggested that OpenSuse "is Very Laptop." After using it for several weeks, I can't agree more. EVERYTHING works. Hybernate, Wireless PCMCIA card, power management. I will see how Suse handles what on apt-get-enabled platforms is called "--dist-upgrade" If it's anything as flawless as on Slackware, I am paying for a commercial Suse package and overwriting the Slack.

Thursday, November 24, 2005

Kalarm SuperKaramba Applet

UPDATE:
Well, the week came and went, and I didn't even start. (Honestly, just had too much fun at my brother's place in Seattle.) So, I guess, this project is not important enough... until the next time I forget to do something. :)




SHORT STORY:

What you see above is a sketch for SuperKaramba applet client for the Kalarm KDE application. (Well, I was hoping to bypass the Kalarm completely and go straight for the Kalarm server through DCOP. I don't want another icon in my systray. Another glob of graphics on my desktop is OK though. Will se if it's possible.)

LONG STORY:

Intro

Missed my South Park episodes again last night. (we all have our guilty pleasures. Mine are South Park, Family Guy and, maybe, American Dad) Also, I always forget to pick up / turn the laundry. It stays there for half a day until my wife asks. She usually asks about it in an unpleasant, somewhat threatening way. Anyway... something should be done about this "forgetfulness" thing.

The Grudge

KOrganizer is an overkill for this. KAlarm is just fine, but don't like to run another "time-tracking" client alongside KOrganizer. If there was a "light" way to add alarms to KOrganizer, instead of having a separate Kalarm server... May be I just don't understand something.
Besides, last time I needed a clock that looks right, I managed to whip up a face for StyleClock. This project looks just as manageable.

(Hmmm... Why don't I just use the StyleClock.... Ahhh, that's right. Clock face corruption after switching the VTs and only one alarm can be set. Otherwise a demn good applet. If only I knew C++...)

So, I need an easy way to:
a) Set the alarm.
b) See how much time is left.
c) (bonus) not have another icon in systray/run another app just to set the alarms.

The Fix

Decided to make a SuperKaramba applet for Kalarm server which:
a) Displays currently set alarms. (DCOP the data off Kalarm server... If there is one.)
b) Allows easy access to setting new alarms. (Just asks Minutes and Text through kdialog > command-line kalarm client > kalarm server.)
c) is very basic in structure > quick to assemble.

Plan

Going to Seattle for a week and a half, starting today. If I can't make the applet in this week and a half, it means it's not worth it. I'll just use the KAlarm.

Sunday, November 6, 2005

Gnome overlords, be very affraid! (Fairytale)

(This was written as a sidenote to the riots following the news of Novell standardising on Gnome. As time passes, you and I may forget that on the background of "the sky is falling" this post may be seen as humorous.)

"Booga Booga"
Dramma in 2 parts

I think Gnome people will be very sorry if they win this fight. Because, then, they will loose the war. "Ugh?!" you say; read on...


Part I "KDE City"

KDE is KDE not because we are uneducated about "the better ways", but because we fundamentally don't give a damn about "the better ways." There are so many of us; there is NO single better way possible. KDE is an elastic building, you can shape it any way you want, and build on top effortlessly.

You can kill the toolkit by pigeonholing it, but you can't keep the massess from wanting a platform that is as elastic and free-willing as itself. If KDE will be shunned into a hole because of Qt's lisencing liabilities we may move over to GTK territory. As I said before, when our forefathers chose Qt, "they didn't give a damn"(c) about lisencing. All they cared about is having a good base to build on. If Qt really becomes a liability for us when it comes to swindling money from the major distros, we will move over to your lawn.



Part II "The Hell of Democracy"

We will tramp your flowers, step on your bare fingers with our heavy boots and spit on your spacial browser from a konquering height. We will forcefully industrialize you, spank your monkey and make GTK dance C++.

The final piece will be the sweetest - the gang of feudal war-lords (you know how you are) will find themselves without your ideologically-brainwashed goons.

If you sink our island, we will move over to yours and, then, there will be no Shire no more....



At that point Miguel de Icaza woke up and realized that it was only a nighmare... or was it?! Tam tam Tam Paaaaam!

KDE - I hope we go down kicking and screaming.


One thing bothered me a lot lately, and the itch became a wound with Novell's announcement of standardization on Gnome. It is the possibility of KDE's imminent demise.

Why KDE is like Childhood in Soviet Union, but better.

I LOVED to be a kid in the Soviet Union. There were very little fences you couldn't cross, with plenty of semi-private property you could care less about. We felt no pain of inadequacy of not having the last-advertised toy because there were no advertisements. There was no limit to who you thought you can be when you grow up, with every boy having a seemingly equal chance of being a communist leader, a cosmonaut, or a neighborhood drunk. Euphoria - was the theme of my every day.
And, then, you grow up and the hangover ends. Clearly thinking, opinionated, enterprising adult had no place in the Soviet Union. (Well, there were rare places: party's leadership, Gulag, Odessa.) One would wander how this machine is still alive. And one day the machine died.

My "childhood" in KDE was incredibly fun. There is much more freedom to grow in KDE sandbox, than on Gnome's raging ocean of sinking sand. Everything makes sense here. Tightly designed toolkit provides clean, fool-proof approach for designing the structure. Being the main kid on the block, KDE was, for a long time, growing on the basis of "Lets do it better", compared to Gnome's constricted "Lets do it better than KDE." The focus on plain improvement (as opposed to "comparative improvement") imho made KDE an awesome community. Having 3 editors is not a sign of bad design. It is a sign of lack of limits, and a sign of community's willingness to contribute in various ways and accept these various ways. Efficiency of singular vision is foreign to KDE, just a as brackets of communist society were foreign to Soviet children. In both societies no one gives a damn. This freedom to use AND create/improve is what makes us tolerant, happy and numerous compared to the niche-minded, well-picked, defensive hordes. That's what makes KDE win most of the popularity polls, despite Gnome's very sane usability tricks.

Why Graduating Up from "Free" Sucks Ass.

Yet, once outside of "childish, no-limits" community, I cannot imagine making serious business with KDE. RedHat, Novell and others of their kind cannot imagine doing business on KDE either. "What is the problem?" you say; commercial projects can pay for the toolkit... And, that's were you go wrong. No one in their right mind wants to pay for anything when it comes to capitalism. "We spare no cost to make the product better" approach works only when you don't bare the cost, like in the Soviet system.

In capitalism, the best resource is the stolen/free one. Paying for something is a two-fold burden. First, you have to give the money for it. Second, you have to keep track of costs and ensure you can justify them with revenue.

Running my own business taught me that the second part is MUCH more painful. Costs, no matter how well-justified they are, only increase your exposure to failure. Anyone who took an economics class knows about "risk aversion." Almost everyone prefers to loose less, rather than gain more, hence, the Novell's choice of default desktop. Yes, GTK is a mangled piece of crap. Yes, it's an ever-changing, horrifically structured, poorly-documented slime-ball of regurgitations of various egoists, but ITS FREE to use in any way you want. Not only you don't have to pay, you don't even have to keep the paperwork. Yumm!

No matter how many times we KDE-maniacs like to utter the "you are free to choose: provide code, or pay the price" you are mistaken about the scope of limitations. People who really have to make this choice ask them-selves, "Why am I forced to make this choice? Screw the Qt sandbox, and all these rules, I'm ganna use that no-strings-attached pile of brown stuff instead." I am seriously contemplating this choice while thinking about doing business around extending / customizing CRM software.

I never bitch about things without and agenda; otherwise it's a waste of time (as compared to moderate waste of time).

MY AGENDA:

1. Troltech, wake up and smell the bacon. 3 Platforms is not a reason enough to charge $3000 plus for a developer's station. Mono/C# is not as cross-platform safe as Qt, but they'll get there, and with much lesser cost to the devs. There's got to be a middle ground on this price thing. I imagine clearly delineated discounts for young businesses, small-business wavers, or other marketing fudge. Big companies are both scared and repulsed by the choices you provide. Small companies don't even consider this a choice.
You have to fight for the damn market place. Openly sponsor a KDE-based distro, do some other summer-of-code lookalike. Hiring devs is not enough. You need to muscle in on the Linux scene.
2. When it comes to potential loss of community there is this. KDE devs need to pay credence to Linus's approach to things: "Constant incremental change is better than one universal solution, for it may never materialize because of the vastness of the goal." Stop scheming for quantum leap with KDE 4. Just do the porting of 3.5 tree to Qt4. Make it solid. Then, feed the faithful incremental improvements. If you expect the userbase to hold the breath for 2-3 years, until your vision of KDE 4 becomes stable, there will not be anyone left to make the quantum leap.
3. Finally, when it comes to potential loss of orther distro sugar-daddies: Real distros don't ship pre, beta, alpha version of DE. If KDE 4 takes 2 years to stabilize, with no clear continuity for KDE in the meantime, KDE-based distros will have nothing to sell for 2 years. Linux users are not Macoholics. Besides, many of us came from Windows and are not in a habit of paying $129 semi-annually for patches or other misc crap. I always skip many point releases. This means no cashflow for distros, and no incentive to think KDE. Guys, my crystal ball shows very little financial support from the up-stream.

EDIT: (I hope) clarified my point #3 a bit.

My first loss of "motherland" was painful enough. Geez, not again.

Monday, October 24, 2005

XOrg 6.9 RC1 (6.8.99.901) - Tested on Slackware


I'm glad to see how easy it was to install XOrg 6.9 rc1 (from source) on Slackware (10.2).

Intro

I was banging my head against the wall trying to make Xv (video overlay) work on my Radeon 8500 with XOrg 6.8.2. (I could output the video streams to xshm but... you know... jerky.)
The ATI proprietary drivers allowed Xv but their GL always froze the system on me. Besides, even if I made that work, composite probably wouldn't. So... the second I saw the release notes for XOrg 6.9 RC1, I knew I had to have it.

Set up

Slackware 10.2
2.6.13 Kernel (fb off; DRM, Radeon as modules)
Intel 815 Chipset
Pen III 950Mhz
Radeon 8500 LE (128 Mb)

Preparation

1. Downloaded the 40+ Meg tarball from here and extracted it.
2. Red the BUILD text file and followed its guidance.
3. Coppied xorgsite.def into host.def (as BUILD recommends) and edited the following things:
- disabled Xnest server (no need for me)
- disabled VirtFB server (no need for me)
- disabled Xprint server (no need for me)
- BuildFontServer = NO
- HasFreeType2 = YES
(The last two are there just as a guarantee of sort that the new stuff will not brake my already perfectly tuned font server (TTF's, antialiasing, hinting, etc))
4. make World (as root, just in case.) (about 6 hours on my machine. May be shorter, I was sleeping through most of it.)
5. make install (as root)
6. rebooted (into init 3)(mostly for the system to find new libraries, etc.)
(if your system is not set up for non-GUI in lilo, at lilo prompt, choose the Linux option and add " 3" (space, number 3, remove quotes) to the line, press enter.)
7. used xorgconfig to set up the XOrg. (I needed it because I used ATI's drivers before. If you used XOrg 6.8.x, just skip this step and leave your /etc/X11/xorg.conf in peace.)
8. Tweaked my /etc/X11/xorg.conf to support composite, AGPFastWrite, Overlay on 2nd CRT. Pointed the mouse device to /dev/input/mice, instead of default /dev/mouse.
9. ran xinit (the X loaded fine - curor showed up. Killed it with CTRL+ALT+SHIFT+BACKSPACE. (I know one key is extra, always forget which one.)
10. Rebooted into my normal runlevel (4, kdm)

Result

1. The best thing is: I have GL hardware accelleraction, Xv and Composite all ON and working flawlessly. In your face (enter your preferred adversary here)
2...
ahh, who cares about other benefits... I'm set.

Sunday, October 16, 2005

YaKuake - Palastik theme

Finally tried YaKuake, after watching people cranking downloads and relating their joy.

Opinion
The default theme became very old, very quick though. It looks OK on the screenie, but plays very bad with my background and konsole style ("linux colors, or dark transparent background")

So, had to spend a night attempting to get this...


Bugs
In the process found a few things that make perfect sence to the developer, but not to themers, like me.

1. The biggest offender is the coordinates system. Some buttons are lined up relative to left side, while others are relative to right - all using positive numbers. If I want to move a button from one side of the toolbar to another, I am screwed as soon, as resolution, or window dimensions change.
Proposed solution: switch to negative numbers for right-allignment. I hope all units, buttons could be alligned to left or right side, by simply using positive or negative values, like all other "widget" apps do.

2. The other glitch (which causes YaKuake to crash) is its inability to handle non-transparent buttons for "plus" and "minus" functions. (possibly all others too, didn't try) Avoiding the transparency was the whole idea. With this bug, I have to leave one pixel transparent on these buttons > my background leeks through.

3. I was hoping I can allign the "add terminal" button in such a way that it always follows the last tab. This way a new terminal tab "grows" out of the "add terminal" button, which now reappears after this new active tab.

I hope I can also express my excitement about the program, but I it seems I spent it all on tweaking. Need to go and sleep now (8 am)

The theme is "done" for now. But I'll "finish" it as soon, as the bugs discussed are taken care of. I sent the theme to the YaKuake maintainer. I am guessing we might see some form of this Palastik with next major release of YaKuake.