Log4Net “Could not find schema information” messages

You can bind in a schema to the log4net element. There are a few floating around, most do not fully provide for the various options available. I created the following xsd to provide as much verification as possible: http://csharptest.net/downloads/schema/log4net.xsd You can bind it into the xml easily by modifying the log4net element: <log4net xsi:noNamespaceSchemaLocation=”http://csharptest.net/downloads/schema/log4net.xsd” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”>

How does the search_path influence identifier resolution and the “current schema”

What is the schema search path search_path? The manual: […] tables are often referred to by unqualified names, which consist of just the table name. The system determines which table is meant by following a search path, which is a list of schemas to look in. Bold emphasis mine. This explains identifier resolution. The “current … Read more

add_column for references (Rails)

While it’s too late to get any points out of this, I thought I’d post the best way for posterity 🙂 use change_table instead of create_table to add columns to a table that already exists, with all the TableDefinition goodness: self.up do change_table :comments do |t| t.references :author end end This might seem trivial, but … Read more

Seed multiple rows at once laravel 5

If you have to use the model you need a loop: foreach($users as $user){ User::create($user); } Otherwise you can just use DB::table() and insert: DB::table(‘users’)->insert($users); Actually you can also call insert() on the model (the resulting query is the same) User::insert($users); Note if you choose the insert method you loose special Eloquent functionality such as … Read more

Does rake db:schema:dump recreate schema.rb from migrations or the database itself?

The answer is simple: from the database. By the way – when you take a look into the source code of db:* tasks you can see that migration tasks calls schema:dump after the run desc “Migrate the database (options: VERSION=x, VERBOSE=false).” task :migrate => :environment do ActiveRecord::Migration.verbose = ENV[“VERBOSE”] ? ENV[“VERBOSE”] == “true” : true … Read more

XML Attributes vs Elements [duplicate]

There is an article titled “Principles of XML design: When to use elements versus attributes” on IBM’s website. Though there doesn’t appear to be many hard and fast rules, there are some good guidelines mentioned in the posting. For instance, one of the recommendations is to use elements when your data must not be normalized … Read more

set default schema for a sql query

A quick google pointed me to this page. It explains that from sql server 2005 onwards you can set the default schema of a user with the ALTER USER statement. Unfortunately, that means that you change it permanently, so if you need to switch between schemas, you would need to set it every time you … Read more

What are XML namespaces for?

They’re for allowing multiple markup languages to be combined, without having to worry about conflicts of element and attribute names. For example, look at any bit of XSLT code, and then think what would happen if you didn’t use namespaces and were trying to write an XSLT where the output has to contain “template”, “for-each”, … Read more

targetNamespace and xmlns without prefix, what is the difference?

targetNamespace is an XML Schema “artifact”; its purpose: to indicate what particular XML namespace the schema file describes. xmlns – because the XML Schema is an XML document, it is then possible to define a default XML namespace for the XML file itself (this is what xmlns attribute does); the implications are multiple: authoring, and … Read more