Pencarian

Rss Posts

 

 

 

Berita pada kategori ‘Sindikasi’

A cool terminal tip for Mac users

Mar 13, 2011

If you use a Mac, and you are dealing with many similar tasks at once, like examining many database servers in different terminals, you may like this one.I have been using iTerm 2 for a while, and my handling of parallel tasks has improved a lot. (No, I am not talking about Parallel replication, although I have applied this trick while testing that technology as well.)iTerm2 has some cool features, and probably the most striking one is split panes. That alone would be a good reason for giving iTerm2 a try. But the one that I use the most, often in combination with Split Panes, is called Send Input to all tabs.Here is how it works. Let’s say I need to use 4 servers at once, and perform a non-repeating operation in all of them.So I open a separate window and I split the screen into 5 panes. I connect to each server in the first four panes, and I open a vim instance in the fifth.With that done, I enable the magic option.A word of caution. This option sends the input to all the open tabs in your current window. If you don’t want this to happen, do as I do, and open a separate window. Then make sure that all tabs, and eventually split panes, are supposed to receive your input. The application asks you for confirmation.After that, whatever I type on one pane will be mirrored on all the panes. So I will see the commands running on my four servers, and being logged in a text file in the fifth one. All with just single command, I have all servers under control at once:

Improved URL auto-linking in Horde – Chuck Hagenbuch

Mar 13, 2011

Horde now uses John Gruber’s regex pattern for matching URLs in text (http://daringfireball.net/2010/07/improved_regex_for_matching_urls).

MySQL Workbench 5.2.32 GA Available

Mar 05, 2011

We’re proud to announce the next release of MySQL Workbench, version 5.2.32. This is a maintenance release featuring
a new and improved UI appearance and several corrections and other enhancements.
The tabbed interface has been refreshed to obtain a clearer separation between different modules of Workbench, while improving responsiveness when switching between tabs. The Query Formatter has been rewritten and is now faster and more robust on its handling of queries. The layout of the Administration module has been changed to allow for easier future expansion and use less vertical screen space. Parts that had problems managing MySQL 5.5 servers have been fixed along other total of 53 bugs or enhancement requests have been addressed.
As always, we want to thank everyone for the great feedback we have received. This helps us to continuously improve the functionality and stability of MySQL Workbench – we appreciate all your ideas for improving MySQL Workbench.? Please keep sending us your ideas!
MySQL Workbench 5.2 GA

Data Modeling
Query (replaces the old MySQL Query Browser)
Administration (replaces the old MySQL Administrator)

Please get your copy from our Download site. Sources and binary packages are available for several platforms, including Windows, Mac OS X and Linux.

http://dev.mysql.com/downloads/workbench/

To get started quickly, please take a look at this short tutorial.
MySQL Workbench 5.2 RC Tutorial

http://wb.mysql.com/?p=406

Workbench Documentation can be found here.

http://dev.mysql.com/doc/workbench/en/index.html

In addition to the new Query/SQL Development and Administration modules, version 5.2 features improved stability and performance ? especially in Windows, where OpenGL support has been enhanced and the UI was optimized to offer better responsiveness.
This release also includes improvements to the scripting capabilities of the SQL Editor. You can read more about it in

http://wb.mysql.com/workbench/doc/

For a detailed list of resolved issues, see the change log.

http://dev.mysql.com/doc/workbench/en/wb-change-history.html

If you need any additional info or help please get in touch with us.
Post in our forums, leave comments on our blog pages or if you want to talk to us directly you can visit us on our IRC channel #workbench on irc.freenode.net.
- The MySQL Workbench Team

Xtrabackup for MySQL, and issues with streaming mode

Mar 05, 2011

Yes, it has been quite some time since I blogged, work has been very busy lately.
Currently we have a number of various backup strategies that our partners may use, one of which has been hot backups via xtrabackup (or innobackup/MySQL Enterprise Backup – with a license fee of course).
At this time we have one person dedicated to maintaining the backups, which includes rewriting innobackupex to handle extras and also write wrapper scripts around the original one.
This morning he contacted me because he was running into problems with xtrabackup 1.5 and streaming. No, not the usual performance issues etc, but rather a few random .MYI files were missing and the xtrabackup_checkpoint and xtrabackup_logfiles were missing.
What was interesting was the the MYI,frm and MYD files missing was random – it was mainly static but would change every now and then when his script ran.
At first glance without reviewing his script, it seemed like something was going on with xtrabackup streaming mode, since the help_*.* files contained the checkpoints info, so it looked like it streamed it to the wrong place..
However, after I was informed about it, I decided to look at the script this person had written, and I realized that he did something like..
innobackupex –backup ……. –stream=tar /path 1>/file.tar 2>/logfile.
After testing, its clear that xtrabackup does not like that. You are not able to separate stdout and stderr like this, since it breaks the application. By changing 1>/file.tar 2>/logfile to just >/file.tar it all worked well.
Why does innobackupex write things to STDERR that should be sent to the tar stream? I do not know, but I hope that someone here can help out.
Either way, this is a reminder for all of you that want to use it – you cannot suppress output, since that will break the stream mode.
Have a great spring!

Generating Google line charts with SQL, part II

Mar 03, 2011

This post continues Generating Google line charts with SQL, part I, in pursue of generating time series based image charts.
We ended last post with the following chart:

http://chart.apis.google.com/chart?cht=lc&chs=400×200&chtt=SQL%20chart&chxt=x,y&chxr=1,-4716.6,5340.0&chd=s:dddddddddeeeeeefffffffffeeeedddcccbbaaZZZYYYXXXXXXXXXYYYZZabbcdeefghhijkkllmmmmmmmmllkkjihgfedcbZYXWVUTSRRQQPPPPQQQRSTUVWXZacdfgijlmnpqrssttuuuttssrqonmkigfdbZXVTSQONMLKJIIIIIIJKLMOPRTVXZbegilnprtvwyz01111110zyxvtrpnkifcaXUSPNLJHFECBBAAABBCEFHJLNQTWZcfilortwy1346789999876420yvspmjfcYVSOL

which has a nice curve, and a proper y-legend, but incorrect x-legend and no ticks nor grids.
To date, Google Image Charts do not support time-series charts. We can’t just throw timestamp values and expect the chart to properly position them. We need to work these by hand.
This is not easily done; if our input consists of evenly spread timestamp values, we are in a reasonable position. If not, what do we do?
There are several solutions to this:

We can present whatever points we have on the chart, making sure to position them properly. This makes for an uneven distribution of ticks on the x-axis, and is not pleasant to watch.
We can extrapolate values for round hours (or otherwise round timestamp resolutions), and so show evenly spread timestamps. I don’t like this solution one bit, since we’re essentially inventing values here. Extrapolation is nice when you know you have nice curves, but not when you’re doing database monitoring, for example. You must have the precise values.
We can do oversampling, then group together several measurements within round timestamp resolutions. For example, we can make a measurement every 2 minutes, yet present only 6 measurements per hour, each averaging up 10 round minutes. This is the approach I take with mycheckpoint.

The latest approach goes even beyond that: what if we missed 30 minutes of sampling? Say the server was down. We then need to “invent” the missing timestamps. Note that we invent the timestamps, we do not invent values. We must present the chart with missing values on our invented timestamps.
I may show how to do this in a future post. Meanwhile, let’s simplify and assume our values are evenly spread.
Sample data
We use google_charts.sql. Note that the timestamp values provided in Part I of this post is skewed, so make sure to use this file.
x-axis values
We use chxl to present with x-axis values. We may be tempted to just list all values. Would that work?
Sadly, no, for two reasons:

Google is not smart enough; whatever we throw at it, it will try to present. So, if we have 288 rows, that’s 288 x-axis values. Not enough room, to be sure! Smarter implementations would automatically hide some values, so as only to present with non-overlapping values.
Our URL will turn out to be too long. Remember: 2048 characters is our maximum limit for GET request!

Also, we must format our timestamp to be of minimal width. In our example, we have a 24 hour range. We therefore present timestamps in hh:MM format. So, a naive approach would be to:

SELECT
CONCAT(
‘http://chart.apis.google.com/chart?cht=lc&chs=400×200&chtt=SQL%20chart&chxt=x,y&chxr=1,’,
ROUND(min_value, 1), ‘,’,
ROUND(max_value, 1),
‘&chd=s:’,
GROUP_CONCAT(
IF(
data IS NULL,
‘_’,
SUBSTRING(
‘ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789′,
1+61*(data – min_value)/(max_value – min_value),
1
)
)
SEPARATOR ”
),
‘&chxl=0:|’,
GROUP_CONCAT(
DATE_FORMAT(ts, ‘%H:%i’)
SEPARATOR ‘|’
)
) FROM chart_data, chart_data_minmax

The resulting URL is just too long.
Solution? Let’s only consider round hour timestamps! Our next attempt looks like this (we also throw in chxs, to show ticks):

SELECT
CONCAT(
‘http://chart.apis.google.com/chart?cht=lc&chs=400×200&chtt=SQL%20chart&chxt=x,y&chxr=1,’,
ROUND(min_value, 1), ‘,’,
ROUND(max_value, 1),
‘&chd=s:’,
GROUP_CONCAT(
IF(
data IS NULL,
‘_’,
SUBSTRING(
‘ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789′,
1+61*(data – min_value)/(max_value – min_value),
1
)
)
SEPARATOR ”
),
‘&chxs=0,505050,10,0,lt’,
‘&chxl=0:|’,
GROUP_CONCAT(
IF(
MINUTE(ts) = 0,
DATE_FORMAT(ts, ‘%H:%i’),
NULL
)
SEPARATOR ‘|’
)
) FROM chart_data, chart_data_minmax

and results with:

http://chart.apis.google.com/chart?cht=lc&chs=400×200&chtt=SQL%20chart&chxt=x,y&chxr=1,-4716.6,5340.0&chd=s:dddddddddeeeeeefffffffffeeeedddcccbbaaZZZYYYXXXXXXXXXYYYZZabbcdeefghhijkkllmmmmmmmmllkkjihgfedcbZYXWVUTSRRQQPPPPQQQRSTUVWXZacdfgijlmnpqrssttuuuttssrqonmkigfdbZXVTSQONMLKJIIIIIIJKLMOPRTVXZbegilnprtvwyz01111110zyxvtrpnkifcaXUSPNLJHFECBBAAABBCEFHJLNQTWZcfilortwy1346789999876420yvspmjfcYVSOL&chxs=0,505050,10,0,lt&chxl=0:|00:00|01:00|02:00|03:00|04:00|05:00|06:00|07:00|08:00|09:00|10:00|11:00|12:00|13:00|14:00|15:00|16:00|17:00|18:00|19:00|20:00|21:00|22:00|23:00

Too messy, isn’t it?
A word about ticks
You would think: OK, then, let’s just present every 4 round hours timestamps. But there’s a catch: a tick will show only when there’s an x-axis value. It’s nice to have a tick for every hour, but we only want to present values every 4 hours.
Fortunately, we can provide with an unseen value: a space (URL encoded as ‘+‘). So we complicate things up a bit on the chxl to read:

SELECT
CONCAT(
‘http://chart.apis.google.com/chart?cht=lc&chs=400×200&chtt=SQL%20chart&chxt=x,y&chxr=1,’,
ROUND(min_value, 1), ‘,’,
ROUND(max_value, 1),
‘&chd=s:’,
GROUP_CONCAT(
IF(
data IS NULL,
‘_’,
SUBSTRING(
‘ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789′,
1+61*(data – min_value)/(max_value – min_value),
1
)
)
SEPARATOR ”
),
‘&chxs=0,505050,10,0,lt’,
‘&chxl=0:|’,
GROUP_CONCAT(
IF(
MINUTE(ts) = 0,
IF(
HOUR(ts) MOD 4 = 0,
DATE_FORMAT(ts, ‘%H:%i’),
‘+’
),
NULL
)
SEPARATOR ‘|’
)
) FROM chart_data, chart_data_minmax

and get:

http://chart.apis.google.com/chart?cht=lc&chs=400×200&chtt=SQL%20chart&chxt=x,y&chxr=1,-4716.6,5340.0&chd=s:dddddddddeeeeeefffffffffeeeedddcccbbaaZZZYYYXXXXXXXXXYYYZZabbcdeefghhijkkllmmmmmmmmllkkjihgfedcbZYXWVUTSRRQQPPPPQQQRSTUVWXZacdfgijlmnpqrssttuuuttssrqonmkigfdbZXVTSQONMLKJIIIIIIJKLMOPRTVXZbegilnprtvwyz01111110zyxvtrpnkifcaXUSPNLJHFECBBAAABBCEFHJLNQTWZcfilortwy1346789999876420yvspmjfcYVSOL&chxs=0,505050,10,0,lt&chxl=0:|00:00|+|+|+|04:00|+|+|+|08:00|+|+|+|12:00|+|+|+|16:00|+|+|+|20:00|+|+|+

OK, I cheated
Who says sample data starts with a round hour? We have that hidden assumption here, since the first tick is necessarily a round hour in our code. Yet our data may start at 12:35, for example. Sorry, you’ll have to dig into mycheckpoint’s source code to see a thorough solution. It’s just too much for this post.
Grids
Let’s wrap this up with grids. Grids work by specifying the step size (in percent of overall height/width) and initial offset (again, in percent).
Wouldn’t it be nicer if grids were automatically attached to ticks? I mean, REALLY! What were those guys thinking? (I know, they’re doing great work. Keep it up!)
Problem is, I have no idea how Google chooses to distribute values on the y-axis. I don’t know where y-axis ticks will be placed. So on y-axis, I just choose to split charts to 4 even parts, and draw horizontal grids between them. Percent is 25 (100/4), offset is 0.
But I do have control over the x-axis. In our case, I know how many ticks we’ll be having. Plus, I made life easier by assuming we start with a round hour, so no offset is required.
Umm… How many ticks do we have? Easy: the number of round hours. This can be calculated by: SUM(MINUTE(ts) = 0. Actually, we need to take 1 off.
We now build the chg parameter:

SELECT
CONCAT(
‘http://chart.apis.google.com/chart?cht=lc&chs=400×200&chtt=SQL%20chart&chxt=x,y&chxr=1,’,
ROUND(min_value, 1), ‘,’,
ROUND(max_value, 1),
‘&chd=s:’,
GROUP_CONCAT(
IF(
data IS NULL,
‘_’,
SUBSTRING(
‘ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789′,
1+61*(data – min_value)/(max_value – min_value),
1
)
)
SEPARATOR ”
),
‘&chxs=0,505050,10,0,lt’,
‘&chxl=0:|’,
GROUP_CONCAT(
IF(
MINUTE(ts) = 0,
IF(
HOUR(ts) MOD 4 = 0,
DATE_FORMAT(ts, ‘%H:%i’),
‘+’
),
NULL
)
SEPARATOR ‘|’
),
‘&chg=’, ROUND(100.0/((SUM(MINUTE(ts) = 0) -1)), 2), ‘,25,1,2,0,0′
) FROM chart_data, chart_data_minmax

and get:

http://chart.apis.google.com/chart?cht=lc&chs=400×200&chtt=SQL%20chart&chxt=x,y&chxr=1,-4716.6,5340.0&chd=s:dddddddddeeeeeefffffffffeeeedddcccbbaaZZZYYYXXXXXXXXXYYYZZabbcdeefghhijkkllmmmmmmmmllkkjihgfedcbZYXWVUTSRRQQPPPPQQQRSTUVWXZacdfgijlmnpqrssttuuuttssrqonmkigfdbZXVTSQONMLKJIIIIIIJKLMOPRTVXZbegilnprtvwyz01111110zyxvtrpnkifcaXUSPNLJHFECBBAAABBCEFHJLNQTWZcfilortwy1346789999876420yvspmjfcYVSOL&chxs=0,505050,10,0,lt&chxl=0:|00:00|+|+|+|04:00|+|+|+|08:00|+|+|+|12:00|+|+|+|16:00|+|+|+|20:00|+|+|+&chg=4.35,25,1,2,0,0

Phew!
Conclusion
So we haven’t worked on offsets. And, this is a single line chart. What about multiple lines? Legend? The following chart:

is harder to achieve. I’m leaving this up to you!

Quick introduction to Embeddability of GlassFish Open Source Edition 3.1

Mar 02, 2011

Embeddability of GlassFish is been around for quite some time now. In 3.1, the embeddable APIs have been revised. Most of the GlassFish community is already aware of the API revision, however I would like to briefly describe the revised APIs in this blog and welcome any feedback.

Embeddable API overview:

API JavaDocs are at http://embedded-glassfish.java.net/nonav/apidocs/

The APIs are briefly categorized as :

(a) Top level APIs (org.glassfish.embeddable) : Provides classes and interfaces necessary to embed GlassFish and perform lifecycle operations, application deployments and runtime configurations

(b) Scattered Archive APIs (org.glassfish.embeddable.archive) : Abstraction for a scattered Java EE archive (parts disseminated in various directories).

(c) Web Container APIs  (org.glassfish.embebdable.web, org.glassfish.embeddable.web.config) : Provides classes and interfaces necessary to programmatically configure embedded WebContainer and create contexts, virtual servers, and web listeners.

(d) Advanced pluggability (org.glassfish.embeddable.spi) : Provides classes and interfaces necessary to plugin a custom GlassFish runtime.

(e) EJB container APIs (javax.ejb.embeddable) : Refer "Embedded Server Guide" for EJB embeddable APIs

Basic examples of embedding GlassFish and deploying applications to embedded GlassFish:

These examples are can be run with either of the following jars in your CLASSPATH:

Full profile uber jar : http://download.java.net/maven/glassfish/org/glassfish/extras/glassfish-embedded-all/3.1/glassfish-embedded-all-3.1.jar
Web profile uber jar: http://download.java.net/maven/glassfish/org/glassfish/extras/glassfish-embedded-web/3.1/glassfish-embedded-web-3.1.jar
Installed GlassFish’s shell jar : $GF_INSTALLATION/lib/embedded/glassfish-embedded-static-shell.jar

Once you have ANY ONE of the above jar file with you, GlassFish can be embedded in your application by simply doing:

import org.glassfish.embeddable.*;

/** Create and start GlassFish */
GlassFish glassfish = GlassFishRuntime.bootstrap().newGlassFish();glassfish.start();

Let us say that you would like 8080 web container port to be started while embedding GlassFish, then you have to do this:

import org.glassfish.embeddable.*;

/** Create and start GlassFish which listens at 8080 http port */
GlassFishProperties gfProps = new GlassFishProperties();
gfProps.setPort("http-listener", 8080); // refer JavaDocs for the details of this API.

GlassFish glassfish = GlassFishRuntime.bootstrap().newGlassFish(gfProps);glassfish.start();

Or let us say that you have 3.1 installation and want to embed GlassFish domain1 in your application, then you can do:

import org.glassfish.embeddable.*;

/** Bootstrap the GlassFish runtime pointing to 3.1 installation */BootstrapProperties bsProps = new BootstrapProperties();bsProps.setInstallRoot(System.getEnv("GF_INSTALLATION"));GlassFishRuntime gfRuntime = GlassFishRuntime.bootstrap(bsProps);

/** Point GlassFish to domain1 */
GlassFishProperties gfProps = new GlassFishProperties();
gfProps.setInstanceRoot(System.getEnv("GF_INSTALLATION") + "/domains/domain1");
GlassFish glassfish = gfRuntime.newGlassFish(gfProps);

glassfish.start();

Note: If you have a custom domain.xml while embedding GlassFish, then you can use setConfigFileURI(String configFile) API of GlassFishProperties. JavaDoc has all the details.

Once you have the GlassFish embedded and is running, you may like to deploy a pre-built Java EE archive using the code below:

import org.glassfish.embeddable.*;

// Obtain the deployer from the glassfish which is embedded via the piece of code above.Deployer deployer = glassfish.getDeployer();

// syntax of deployment params are same as how they are passed to 'asadmin deploy' command.deployer.deploy(new File("simple.war"), "--contextroot=test", "--name=test", "--force=true");

// if you have no deployment params to pass, then simply do this:deployer.deploy(new File("simple.war")); 

If your archive is not pre-built, instead it’s components are scattered in multiple directories, then you may be interested in using the scattered archive APIs:

import org.glassfish.embeddable.*;import org.glassfish.embeddable.archive.*;

Deployer deployer = glassfish.getDeployer();

// Create a scattered web application.ScatteredArchive archive = new ScatteredArchive("testapp", ScatteredArchive.Type.WAR);// target/classes directory contains my complied servletsarchive.addClassPath(new File("target", "classes"));// resources/sun-web.xml is my WEB-INF/sun-web.xmlarchive.addMetadata(new File("resources", "sun-web.xml"));// resources/MyLogFactory is my META-INF/services/org.apache.commons.logging.LogFactoryarchive.addMetadata(new File("resources", "MyLogFactory"), "META-INF/services/org.apache.commons.logging.LogFactory");

deployer.deploy(archive.toURI())

Similarly, the scattered enterprise application (EAR type) can be deployed like this:

import org.glassfish.embeddable.*;import org.glassfish.embeddable.archive.*;

Deployer deployer = glassfish.getDeployer();

// Create a scattered web application.ScatteredArchive webmodule = new ScatteredArchive("testweb", ScatteredArchive.Type.WAR);// target/classes directory contains my complied servletswebmodule.addClassPath(new File("target", "classes"));// resources/sun-web.xml is my WEB-INF/sun-web.xmlwebmodule.addMetadata(new File("resources", "sun-web.xml"));

// Create a scattered enterprise archive.ScatteredEnterpriseArchive archive = new ScatteredEnterpriseArchive("testapp");// src/application.xml is my META-INF/application.xmlarchive.addMetadata(new File("src", "application.xml"));// Add scattered web module to the scattered enterprise archive.// src/application.xml references Web module as "scattered.war". Hence specify the name while adding the archive.archive.addArchive(webmodule.toURI(), "scattered.war");// lib/mylibrary.jar is a library JAR file.archive.addArchive(new File("lib", "mylibrary.jar"));// target/ejbclasses contain my compiled EJB module.// src/application.xml references EJB module as "ejb.jar". Hence specify the name while adding the archive.archive.addArchive(new File("target", "ejbclasses"), "ejb.jar");

deployer.deploy(archive.toURI())

Finally, towards the end of your application, you would like to stop/dispose your embedded GlassFish:

import org.glassfish.embeddable.*;

/** Stop GlassFish */
glassfish.stop(); // you can start it again.

/** Dispose GlassFish */glassfish.dispose(); // you can not start it again. But you can embed a fresh glassfish with GlassFishRuntime.bootstrap().newGlassFish()

More Examples:

If you checkout https://svn.java.net/svn/glassfish~svn/trunk/v3/tests/embedded you will find many more examples which cover embeddable web container APIs also.

Feedback:

If you have any feebback on the APIs, please send them to dev@glassfish.java.net or dev@embedded-glassfish.java.net

SQL Oddity: ALTER TABLE and default values

Mar 02, 2011

?So, the MySQL (and Drizzle) ALTER TABLE syntax allows you to easily change the default value of a column. For example:
CREATE TABLE t1 (answer int);
ALTER TABLE t1 ALTER answer SET DEFAULT 42;
So, you create a TIMESTAMP column and forgot to set the default value to CURRENT_TIMESTAMP. Easy, just ALTER TABLE:
create table t1 (a timestamp);
alter table t1 alter a set default CURRENT_TIMESTAMP;
(This is left as another exercise for the reader as to what this will do – again, maybe not what you expect)

Using Horde_Xml_Element to quickly generate XML from arrays – Chuck Hagenbuch

Feb 20, 2011

Horde_Xml_Element gives you a quick shortcut for taking PHP arrays and turning them into XML.

Symfony ? subfolders for partials – Anna Filina

Feb 19, 2011

Symfony 1.2 ? 1.4 expects all partials to follow this convention: templates/_partial.php

What happens when you need to organize your partials in subfolder? I tried a number of ?Symfunky? avenues. Feel free to skip to the solution.

Avenues Explored

I first try the call the include_partial helper with ?subfolder/partial?, but that results in Symfony attempting to find the partial in the ?subfolder? module.

Alright, so I try ?module/subfolder/partial?, but that results in Symfony looking for ?_subfolder/partial? because it simply split at the first backslash. I don?t blame the framework developers: I am trying to do something it was not meant to do.

So now I realize that we can set any template from an action using $this->setTemplate(?subfolder/_partial?). Since actions are NOT partials by definition, I decide to use a component. Unfortunately the component doesn?t allow the developer to override templates.

I am starting to feel that the framework mocks me.?So this is how you wanna play it, huh? I will override your sfView class, load it in factories.yml, and there?s nothing you can do about it (insert diabolical laughter)! But then, after almost half an hour, I realize that I?m trying to make it too elegant for something so basic as concatenating a few strings.

Solution

The solution ended up ridiculously simple and does not risk breaking any existing code.

1. Copy get_partial() helper with an extra param: get_partial_subfolder($templateName, $vars = array(), $subfolder)
2. Edit the line that concatenates the file name: $actionName = $subfolder.?/_?.$templateName; (instead of ?_?.$templateName)

There you go, no more headaches. Just remember to use ?echo get_partial()? instead of ?include_partial()? unless you want to override that helper as well. If you are unsure how to create custom helpers, see here under Adding Your Own Helpers: http://www.symfony-project.org/book/1_2/07-Inside-the-View-Layer

MepSQL Debs for Ubuntu now released – courtesy of cool tweaks to the build system.

Feb 19, 2011

After another week of hacking on MepSQL the DEB files for Ubuntu are now available.(MepSQL is my new “just a hobby” MySQL fork project.)
The Download page has instructions on how to install the packages with a simple apt-get install command. Debian packages will appear soon as they are now easy to add – I mostly just need to add new Amazon images for each.
read more