Just got a server hard drive crash
We should be back operational soon. In the mean time please bear with us. Thank you.
Just got a server hard drive crash
We should be back operational soon. In the mean time please bear with us. Thank you.
Upgrading to the latest RubyGems in Ubuntu Gutsy is a bit non-straightforward. I’d like to share a quick fix this time. It’s trivial when you know it, but if not, a friend of mine has almost hosed his system just because of this annoying “bug”.
Installing Ruby in Ubuntu is pretty simple:
sudo aptitude install ruby ri irb rdoc rubygems libruby-extras libmysql-ruby ruby1.8-dev
(add other packages as you see fit)
The problem occurs right after you upgrade RubyGems to the latest version:
sudo gem update --system
Then you get something like this:
I need your help to buy a new USB keyboard in the next few days. I’ve been typing exclusively on a laptop for the past 4 months and by God, my hand hurts like hell right now and I don’t intend continuing so.
This isn’t any regular Ruby post.
So, let me know of your recommendations. It’d be great if you actually used it or typed on it, nevertheless any links would be helpful.
The winner recommendation will get a personal thanks from me. (I mean that literally)
Kadang-kadang manusia memang keterlaluan malasnya. (pointing at myself)
Bingung gimana caranya mindahin daftar URL yang di Planet Ruby Indonesia ke halaman Daftar Situs Ruby di Wiki Ruby Indonesia.
Jadi ya, terpaksa deh… pake “cara lama”. Select, View Source, Copy&Paste, ketik sedikit kode Ruby…
Seriously, on a more conceptual level, user interface is not just about flashy effects and visual treats.
Enter: Bill Higgins’ The Uncanny Valley of User Interface Design. (via Ajaxian)
Observe:
There’s a lesson here for software designers, and one that I’ve talked about recently – we must ensure that we design our applications to remain consistent with the environment in which our software runs. In more concrete terms: a Windows application should look and feel like a Windows application, a Mac application should look and feel like a Mac application, and a web application should look and feel like a web application.
This is far from being a Ruby post.
But it got me smiling (although evilly).
// set the shitty parameter stuff (I hate Crystal Reports!!!)
ParameterDiscreteValue pdv = new ParameterDiscreteValue();
pdv.Value = title;
workSessionsByEmployee.ParameterFields["RangeTitle"]
.CurrentValues =
new ParameterValues(new ParameterValue[] { pdv });
crystalReportViewer.ParameterFieldInfo =
workSessionsByEmployee.ParameterFields;
workSessionsReportTableAdapter.FillByRange(
absensiStainDataSet.WorkSessionsReport,
begin, end);
...
workSessionsByEmployee.SetDataSource(absensiStainDataSet);
...
private void crystalReportViewer_ReportRefresh(object source,
CrystalDecisions.Windows.Forms.ViewerEventArgs e) {
// and this is still needed! For God sakes!!!
e.Handled = true;
}
Yes, it came from a client’s Visual Studio 2005 (C#) project that I wrote (pity who?), only a few months old.
One of the performance-hurting issue in current Active Record is that it doesn’t allow you to lazy load BLOB columns (and sometimes, TEXT columns), which can contain huge data. Usually there’s nothing wrong, theoretically, with loading all columns. But let’s see how we can improve performance by lazy loading these columns…
Using Views to Lazy Load Columns
My workaround is not to create a separate table, but just create a separate view (I’m using PostgreSQL, but I believe you can do that too with recent MySQL). This view doesn’t contain the blob fields. I use set_table_name in the model to use this view. Since the view is updatable (in PostgreSQL you have to create several RULEs on the view to make it insert/update/delete-able), Active Record doesn’t know it’s dealing with a “fake” table.
Active Record associations (has_many, has_one, belongs_to, has_and_belongs_to_many, etc.) only allows you to set :dependent as :destroy, :delete_all, or :nullify.
In the “real world”,some DBMSs (like PostgreSQL, which happen to be my favorite) allow you to have NO ACTION / RESTRICT during delete or update. Putting this on the DBMS will work most of the time. However, when you do testing with transactional fixtures, this will very likely cause problems. A failed statement will cause the transaction to “hang”, which can cause nasty error messages.
Besides, you want to handle these kinds of stuff in your Active Record model, don’t you? Here’s one quick way, use the “before_destroy” handler:
Overheard from Bugzilla:
Setting the default application on Vista doesn’t seam to work.
…
——- Comment #27 From Seth Spitzer [:ss] 2006-09-20 09:45 PST [reply] ——-
doug / robert. here come questions. please forgive my Vista / COM ignorance
in advance!1) for non-Vista, in nsWindowsShellService::SetDefaultBrowser(), we write the
existing settings to MOZ_BACK_REGISTRY, and then in
nsWindowsShellService::RestoreFileSettings(), we restore them.So for Vista, shouldn’t that mean we should be calling ClearUserAssociations()
in nsWindowsShellService::RestoreFileSettingsVista()?2) nsWindowsShellService::SetDefaultBrowser() takes a bool, aForAllUsers.
Shouldn’t this be passed through to SetDefaultBrowserVista(), and if false,
shouldn’t we calling SetAppAsDefault() with the appropriate ASSOCIATIONLEVEL?
SEO (Search Engine Optimization) is becoming more and more difficult nowadays. Other than the obvious fact that there are lots of search engines, several big ones (the ubiquitous Google included), and also meta search engines and a host of other complications.
Now it’s becoming more common for search engines to have their own “sliders” for manipulating the search results. Google has Personalized Search (Beta) and others like MSN Search has something like this too.
When you think Google’s Personalized Search or “Search the Web” or “Search only in…” or SafeSearch are the only ones manipulating your results, well I thought the same way… But was I ever been more wrong: