12

I'm building an in-game browser RoR app for Eve Online. One of the requirements of my app is displaying an SVG graph generated by graphviz. I'm having some issues getting my requirements met within this environment.

No official documentation is available for Eve's IGB, but the wiki indicates:

The new EVE Online in-game browser (code-named Moondoggie) is based on a technology stack combining two elements:

Awesomium: A middleware layer that delivers rendered webpages as data parseable by a 3D engine. Awesomium is developed by Khrona Software.

Chromium: A middleware layer that provides interprocess communication, webpage rendering, HTTP communications, and all the other basics needed for writing a web browser. It is, itself, based on Apple’s Webkit framework. Chromium is an open-source project championed primarily by Google.

Because of this, Moondoggie is able to pass the Acid3 test and thus can support the full HTML 4.01 and CSS3 specifications.

I need the links I'm including in the SVG to have access to my app's javascript. Embedding it with <embed> or <object> puts the SVG out of the scope of my JS files.

Using <embed> or <object> DOES render the svg properly within the in-game browser. When it is inline like I have it below, it displays one line of text containing JUST the text elements from the SVG.

Update Here's where I'm at. I'm pretty sure most of this is redundant, as I didn't notice a difference by just using the render file: inside my view on its own. I think the mime type registration is more for use with respond_to, but I'm not really sure how to use that in this scenario.

snippet of main view:

<%= render "map/map" %>

partial view file:

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:svg="http://www.w3.org/2000/svg">
<head>
    <title>Embedded SVG</title>
</head>
    <body>
        <%= render file: @map.output_file_path %>
    </body>
</html>

config/initializers/mime_types.rb:

Mime::Type.register "image/svg+xml", :svg  

I don't understand why it renders fine inside an <object> tag but not when inline. How do I emulate the environment inside an <object> in my main view? Or, how can I give the <object> tag access to my javascript functions?


ODP.NET Connection Pooling Parameters

I am trying to configure connection pooling for my .NET application using ODP.NET version 2.111.6.20. The database is Oracle 11.1.

I am using the following connection string in my .NET 2.0 application:

Data Source=prod; User Id=FAKE_USER; Password=FAKE_PASS; Pooling=true; Min Pool Size=2; Max Pool Size=5; Connection Timeout=30;"

According to the documentation the connection pool should initialize with 2 connections and and increment up to 5 connections as needed. It should never get higher than 5 connections.

What I am seeing is the the connections are growing 2 at a time and growing up to 10 connections. I am monitoring the connections in the Oracle database by querying the v$session table so I know the connections are from that specific application originating from my application.

If anyone can help me identify what might be happening in the connection pool inside this application that might be allowing for more than the Max number of connections I would appreciate it.

Sample C# Code

Here is a sample of the code making the calls to the database:

const string connectionString = "Data Source=prod; User Id=FAKE_USER; Password=FAKE_PASS; Pooling=true; Min Pool Size=5; Max Pool Size=5; Connection Timeout=30;";

using (OracleConnection connection = new OracleConnection(connectionString)) {
    connection.Open();

    using (OracleCommand command = new OracleCommand("ALTER SESSION SET TIME_ZONE='UTC'", connection)) {
        command.ExecuteScalar();
    }

    using (OracleTransaction transaction = connection.BeginTransaction()) {
        const string procSql = @"BEGIN P_SERVICES.UPDATE_VERSION(:id, :version, :installDate); END;";
        using (OracleCommand command = new OracleCommand(procSql, connection)) {
            command.Parameters.Add(new OracleParameter("id", OracleDbType.Varchar2) { Value = id });
            command.Parameters.Add(new OracleParameter("version", OracleDbType.Varchar2) { Value = version });
            command.Parameters.Add(new OracleParameter("installDate", OracleDbType.TimeStamp) { Value = dateUpdated });

            try {
                command.ExecuteNonQuery();
            } catch (OracleException oe) {
                if (Log.IsErrorEnabled) {
                    Log.ErrorFormat("Update Error: {0}", oe.Message);
                }

                throw;
            }

            transaction.Commit();
        }
    }
}
4

1 回答 1

4

可以从父文档访问 <object> 或 <embed> 内的文档。这是 ACID3 仍在测试的(太少的)svg 事物之一。

这是一个如何从父 html 文档中的脚本修改 svg 文档的示例。

于 2013-04-23T13:17:39.920 回答