Friday, January 14, 2011
Samba and iptables UDP broadcast issues
Have been having issues with browsing Samba from Windows boxes or vice-versa for years, like me? No wonder - just google for "ip_conntrack_netbios_ns site:samba.org". See? It's not documented or even mentioned that that kernel module must be loaded for NetBIOS broadcasts to get thru firewall, except for one recent post, even though the issue was raised and solved 5 years ago: https://bugzilla.redhat.com/show_bug.cgi?id=113918 .
Wednesday, January 5, 2011
Notebook MSI X430 (aka X420 aka X410) - Big Disappointment
So, I've been shopping for notebook for some time - my current work model, HP Compaq nx9420, has been failing me for like 1.5yrs now, with its lid hanging on just one corner (the steel support plate in there broke, nice job, HP!). I also grew pretty tired to carry it's 3.3kg around, so was shopping for subnotebook. So, criteria was: minimal weight, workable screen size (12" is kinda small, 14" is kinda heavy, those are extreme bounds), budget price (also tired to shell out a grand+, especially that nx9420 shows that no matter how much you pay, you have strong chance to get budget quality nowadays).
I had Acer Timeline t3810 (or something close) in my shopping list, but was swamped by real world, so when I came closer to actual shopping - oops, that model is no longer available. That's another trait of modern hardware market - it's not like good stuff gradually becomes cheaper and better stuff comes in, it's like good stuff being replaced by more expensive and mediocre one.
So, I started looking for another replacement, and I found MSI X430. Gosh, it was brilliant. They cramped 14" in 1.5kg - there was/is no competitor in that regard. Battery life was crap (~2hrs), but that's actually brilliant engineering thought. Because laptop battery doesn't last "X or Y hours", it lasts untill next hot summer - when it completely dies. So, it makes little sense to pay lot for large battery which will anyway die soon. So, thanks to that nice crappy battery, X430 costed just $500 (my ideal upper bound for a contemporary piece of technical stuff), it made decent weight to of course. The performance wasn't great, but at least it had latest AMD X2 which has come to these vicinities, L335.
Guess what - when I started to actually call shops, it turned out the model went out of stock like a week ago. Yes, it was on hot sale the whole summer, and boom, suddenly there's only X410 & X420 which are less performance and/or much more pricey. Well, I waited a bit, and oh, miracle - one shop got it back.
Got it in a day, just to find out that:
No, I will not. I'm not keen on returning stuff, but that box went back to the shop. And I even wrote this blog post ;^).
I had Acer Timeline t3810 (or something close) in my shopping list, but was swamped by real world, so when I came closer to actual shopping - oops, that model is no longer available. That's another trait of modern hardware market - it's not like good stuff gradually becomes cheaper and better stuff comes in, it's like good stuff being replaced by more expensive and mediocre one.
So, I started looking for another replacement, and I found MSI X430. Gosh, it was brilliant. They cramped 14" in 1.5kg - there was/is no competitor in that regard. Battery life was crap (~2hrs), but that's actually brilliant engineering thought. Because laptop battery doesn't last "X or Y hours", it lasts untill next hot summer - when it completely dies. So, it makes little sense to pay lot for large battery which will anyway die soon. So, thanks to that nice crappy battery, X430 costed just $500 (my ideal upper bound for a contemporary piece of technical stuff), it made decent weight to of course. The performance wasn't great, but at least it had latest AMD X2 which has come to these vicinities, L335.
Guess what - when I started to actually call shops, it turned out the model went out of stock like a week ago. Yes, it was on hot sale the whole summer, and boom, suddenly there's only X410 & X420 which are less performance and/or much more pricey. Well, I waited a bit, and oh, miracle - one shop got it back.
Got it in a day, just to find out that:
- Max amount of memory ambgiously (not explicitly) mentioned in the docs is 2Gb. Come on, this is not netbook, which 2Gb?? And it doesn't have dedicated RAM cover to easily try 4Gb module - would need to disassemble it completely (either void warranty or go to service center - with what - 4Gb SODIMM I purchased not knowing if it works or not?)
- Booted Ubuntu 10.10. Got complete mess on the screen, more specifically torn off signal sync. Remember how old CRT TVs looked with broken row sync heterodyne? I couldn't even imagine that effect can be so faithfully reproduced on LCD panel! I was able to found just single report of someone else facing that, did some hacking, found a workaround, and then thanks to DRM driver people found easy solution. So, well, that DRM/Ubuntu issue, though, taking into account all points above and below, MSI engineers outwitted themselves too. (Support for such funky videoadapeters, as in X430, will be (was) fixed in next kernel version).
- One final point which really put me over the edge and made me return the thing. Its touchpad doesn't support scrolling. Well, to be exact, it does, in a following manner: you have to tap at top right corner to scroll up, somewhere near bottom right corner to scroll down. So yes, you had to target the tap, and target pretty carefully, requiring an eye-look. How that compares with familiar blind swipe near the right side? If that sounds like a petty complaint, you've got to use that yourself! Remember, I started all ecstatic about the box, and that dissatisfaction grew subconscious ways. It's like making you walk on the knees. Many people would say "So what? Connect any mouse you like, voila!" Well, but I'm buying a subnote to be light and lean and not carry extra stuff, and still being able to use it comfortably. If to start bringing around crutches everywhere, why bother with lack of selection, higher price, lower performance of subnote? Well, I started to drop into any notebook shop I saw in city motion and know what - all notebooks out there have sane touchpad scrolling, newer ones brag about multi-touch (2-finger) scrolling with stickers, couple of MSI models were the only ones with such brain-dead scrolling. I finally made a search over the Internet. And found dozen-of-pages hate-topics regarding MSI's touchpads. People go by any length to do something with them, like soldering out that thing and solder in normal touchpad.
No, I will not. I'm not keen on returning stuff, but that box went back to the shop. And I even wrote this blog post ;^).
Wednesday, December 29, 2010
Mercurial goes down in my list comparing to git
For a long time a valued Merurial not less, if not more, than git. Well, until I started to use it for more than just local tracking of files.
So, you have working copy changes, do hg pull/update which conflicts with them. You're told:
So you edit the file to resolve conflicts, then run
Right? No, because you get very strange output:
And see that all your careful edits are blown away and file is back to conflicted state. Now you read man, to find out that you need to use -m option to mark file as resolved.
The question is: how can someone design such a UI that not only requires additional option for the most common operation, but also by default silently clobber users changes, which may be result of an hour or so of work? They say that git's interface is not that good (I used to think that too). Just look around.
So, you have working copy changes, do hg pull/update which conflicts with them. You're told:
use 'hg resolve' to retry unresolved file mergesSo you edit the file to resolve conflicts, then run
hg resolve hg.txtRight? No, because you get very strange output:
merging foo.txt
warning: conflicts during merge.
merging foo.txt failed!
And see that all your careful edits are blown away and file is back to conflicted state. Now you read man, to find out that you need to use -m option to mark file as resolved.
The question is: how can someone design such a UI that not only requires additional option for the most common operation, but also by default silently clobber users changes, which may be result of an hour or so of work? They say that git's interface is not that good (I used to think that too). Just look around.
Thursday, December 16, 2010
Some WinCE links
- Enlightment on WinCE
- Qt/KDE on WInCE - includes notes on CAB packaging using pocketpc-cab script and lcab
- Windows CE .NET Advanced Memory Management (CE 3.0/4.x)
- Windows Mobile 6.1 Memory Management Changes (CE 5.x)
- Windows Embedded CE 6.0 Advanced Memory Management
Saturday, December 4, 2010
WebKitGtk vs QtWebKit
Comparing functionality and features of Qt (QtWebKit) and GTK+ (WebKitGtk) ports of WebKit.
Midori FAQ has an entry on this ("Scrolling on website xyz is very slow").
It turns out that this can be result of multiple bugs:
Examples:
Related:
As of now, QtWebKit 2.1 is still not released.
Btw, according to the patch, nearest-neigh filter is used exactly by default, it can be changed by client. Need to try that in Arora. - Well, not in Qt 4.6.3, there GraphicsContext::setImageInterpolationQuality() is empty.
Scrolling Performance
It seems that as of 1.2.5, WebKitGtk has one fairly big usability issue comparing to QtWebKit: it has very slow (and high CPU usage) scrolling on some pages/sites. All browsers based on WebKitGit are slow on those pages, while all browsers based on QtWebKit are OK there, so that's indeed a framework issue.Midori FAQ has an entry on this ("Scrolling on website xyz is very slow").
It turns out that this can be result of multiple bugs:
- [Cairo] Enhance the performance of shadowed elements by tiling the shadow area - biggest contributor apparently
- [Cairo] Font fallback determination is very ineffecient
Examples:
- http://www.cmlenz.net/archives/2008/03/python-httplib-performance-problems: glorious example - scrolls well in the post body, but as soon as reaches table of comments, it's a crawl if not a hang.
- http://careers.stackoverflow.com/Jobs/7000/stack-overflow-developer-stack-overflow: entire page scrolls bad (note: most StackOverflow pages are not affected).
- http://forums.urbanterror.info/topic/22445-intel-gma-hd-performance-gma5700mhd/
- http://techfreaks4u.com/blog/?p=1021: just degraded scrolling performance.
- Login to Twitter, go to http://twitter.com/#!/search/#linux
Related:
- http://blogs.igalia.com/alex/2010/09/17/rendering-shadows-and-tiles/
- https://bbs.archlinux.org/viewtopic.php?pid=860692
Image Scaling Quality
On the other hand, when scaling images, QtWebKit 4.6.3 appears to (by default?) use nearest neighbour filter, while WebKitGtk uses smooth bilinear filter. In Qt 4.7.1 it's the same.
But it seems to be fixed in the latest QtWebKit, this post tells:
But it seems to be fixed in the latest QtWebKit, this post tells:
[01 Sep 2010] Re: no interpolation after scale image to a larger size?
This was fixed here:
[Qt] Enable smooth pixmap transforms by default
The change was too late for Qt 4.7 but will be part of the upcoming
QtWebKit 2.1 release.
As of now, QtWebKit 2.1 is still not released.
Btw, according to the patch, nearest-neigh filter is used exactly by default, it can be changed by client. Need to try that in Arora. - Well, not in Qt 4.6.3, there GraphicsContext::setImageInterpolationQuality() is empty.
Thursday, December 2, 2010
Bash Braindeadness: Logical Connectives
UPDATE: As was pointed out on Ubuntuforums, "true -a false" on its own is running command "true" with parameters "-a" and "false", and "true" deliberately silently ignores its arguments. So again, "-a" & "-o" have logical connective semantics only as arguments to test/[. The below is stylistic feature ;-).
So I've been debugging a shellscript which didn't do what it should have been (not mine). Everyone likes using kewl idioms, so there was:
Well, just gotta choose right language. Because in bash:
Wanna more? Easily:
So, from looks of these examples, in bash, both logical AND and OR have the same truth table, and semantics of "return first argument". Now, wazzup?
Googling surprisingly doesn't give good hits - obviously, because you have troubles searching for "-a", "-o", "and" or "or". Googling for "logical and in bash" gives one good hit on 1st page - http://ubuntuforums.org/showthread.php?t=754338. There, some guy wonders why both [ 0 -a 0 ] and [ 0 -a 1 ] are true, but not really being answered.
So, by reading man bash a really careful reader may notice that -a and -o (in a sense of binary logical connectives) are defined within description of test aka [ command. The description also says "Expressions are composed of the primaries described above under CONDITIONAL EXPRESSIONS." And CONDITIONAL EXPRESSIONS list only checks like -a and comparisons, and no thing like shell commands, integer or string literals, etc. So, careful deductive reader might pose hypothesis:
Logical -a, -o are defined only within scope of test aka [ command. And there, they must apply only to legitime boolean expressions - checks and comparisons. Usage of -a, -o in any other context silently produces undefined result.
Of course, any decent language would give error if some operator is used in wrong context. But Unix shell in general, and Bash in particular, have always been special. So, be it historically preserved bug, or GNU Bash own invention, the end result is the same - you don't need the Brainfuck language or other alike novelties to have some fun - with bash, you can get unexpected results right at your fingertips, at any Linux workstaion around the world.
So I've been debugging a shellscript which didn't do what it should have been (not mine). Everyone likes using kewl idioms, so there was:
check val1 -a check val2 && do_something
Well, just gotta choose right language. Because in bash:
$ false -a false; echo $?
1
$ false -a true; echo $?
1
$ true -a false; echo $?
0
$ true -a true; echo $?
0
Wanna more? Easily:
$ false -o false; echo $?
1
$ false -o true; echo $?
1
$ true -o false; echo $?
0
$ true -o true; echo $?
0
So, from looks of these examples, in bash, both logical AND and OR have the same truth table, and semantics of "return first argument". Now, wazzup?
Googling surprisingly doesn't give good hits - obviously, because you have troubles searching for "-a", "-o", "and" or "or". Googling for "logical and in bash" gives one good hit on 1st page - http://ubuntuforums.org/showthread.php?t=754338. There, some guy wonders why both [ 0 -a 0 ] and [ 0 -a 1 ] are true, but not really being answered.
So, by reading man bash a really careful reader may notice that -a and -o (in a sense of binary logical connectives) are defined within description of test aka [ command. The description also says "Expressions are composed of the primaries described above under CONDITIONAL EXPRESSIONS." And CONDITIONAL EXPRESSIONS list only checks like -a and comparisons, and no thing like shell commands, integer or string literals, etc. So, careful deductive reader might pose hypothesis:
Logical -a, -o are defined only within scope of test aka [ command. And there, they must apply only to legitime boolean expressions - checks and comparisons. Usage of -a, -o in any other context silently produces undefined result.
Of course, any decent language would give error if some operator is used in wrong context. But Unix shell in general, and Bash in particular, have always been special. So, be it historically preserved bug, or GNU Bash own invention, the end result is the same - you don't need the Brainfuck language or other alike novelties to have some fun - with bash, you can get unexpected results right at your fingertips, at any Linux workstaion around the world.
USB gives a lesson in physics
With a recently bought mouse:
Googling shows affected are many, yet few good explanations are provided. This good post explains that it is indeed caused by an electrostatic discharge (ESD), which, kernel can be agreed with, may be seen as an extreme case of electo-magnetic interference (EMI).
[176149.256699] hub 3-0:1.0: port 1 disabled by hub (EMI?), re-enabling...
[176149.256706] hub 3-0:1.0: over-current change on port 1
[176149.357643] usb 3-1: USB disconnect, address 3
[176149.569692] usb 3-1: new low speed USB device using uhci_hcd and address 4
[176149.734362] usb 3-1: New USB device found, idVendor=093a, idProduct=2510
[176149.734371] usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[176149.734377] usb 3-1: Product: USB OPTICAL MOUSE
Googling shows affected are many, yet few good explanations are provided. This good post explains that it is indeed caused by an electrostatic discharge (ESD), which, kernel can be agreed with, may be seen as an extreme case of electo-magnetic interference (EMI).
Subscribe to:
Posts (Atom)