default

WPF Setting the default style on a TextBlock overrides the style for a Label

Setting the default style on a TextBlock causes the style in the Label and other controls to be set as well. This only happens if you put the styles in the Application resources, when I place the style in the Window resources everything is fine. I have also found that the VS 2008 Designer and XamlPadX display the Label as you would expe...

How can I monitor the opened URLs via java.net.URL class in a Java program?

Hi all, I am working on a big (lots of classes) java project and I have it's source code but most of the classes are dynamically created or downloaded via ClassLoaders. Anyways, I'd like to be able to "override" the java.net.URL class so I could trace down the calls to open a url. I can not use a sniffer because the content is SSL encryp...

Prevent PHP date() from defaulting to 12/31/1969

Hi, I am using a MySQL database with PHP. I store my date values in the database using the DATETIME field. I'm using this PHP code to convert inputted dates to the appropriate format for MySQL. date("Y-m-d H:i:s", strtotime($inputDate)) However, whenever a date is invalid, it is placed in the database as 1969-12-31 19:00:00 Is ther...

Visual Studio's default browser will not change from Internet Explorer

I've tried the browse with... method and went into Chrome to make it my default. VS says Chrome is my default, but no matter what I try to do, it opens a new window in IE. VS 2008, IE8 How do I make it open a window in Chrome?! EDIT:: Just uninstalled IE8, and now it opens in Chrome, but it gives me an error when I compile. Unabl...

Change WCF default timeout

Hi, I have here a WCF Duplex Service, the requierement is that the Callback to the client should have a timeout of 10 seconds, therefor my web.config file of the Service looks like this: <bindings> <basicHttpBinding> <binding name="simulatorEndpoint" closeTimeout="00:00:10" openTimeout="00:00:10" ...

What is the equivalent in F# of the C# default keyword ?

Hi, I'm looking for the equivalent of C# default keyword, e.g: public T GetNext() { T temp = default(T); ... Thanks ...

In Ruby, how can you invoke a method using its default argument or with a specified argument without repeating code?

Say I have a ruby method: def blah(foo=17) ... end In code I want to invoke blah with a specific argument "blah(a)" or invoke blah using its default argument "blah()" Is there any way to do that without specifying the method name twice? I'm trying to avoid: if a.nil? blah() else blah(a) end Because it makes the code look m...

Django flatpages and a catchall startpage

I'm using django 1.1 and flatpages. It works pretty well, but I didn't manage to get a catchall or default page running. As soon as I add a entry to url.py for my startpage, the flatpages aren't displayed anymore. (r'^', 'myproject.mysite.views.startpage'), I now flatpages uses a 404 hook, but how do you configure the default website...

How can I use an optional array argument in a VBA procedure?

I've got a private procedure in a VBA script for MS Access: Private Sub drawLineDiagram(chartSpace As Variant, title As String, caption As String, x_val() As Variant, y_val() As Variant, Optional y_val2() As Variant = ????) As you see, I want to have an optional last parameter for an array of values. What kind of default parameter mu...

Script to generate default values for not columns with no defaults specified in SQL Server

I have a MySQL database that I am migrating to SQL Server. The application that references the database breaks when I run it against SQL Server because SQL Server does not offer the implicit defaults that MySQL offers. I wanted to see if there is a way to generate script that would force defaults on all NOT Null columns that do not have...

[C#] How to get the default value of an object property?

Some code: foreach (System.Reflection.PropertyInfo pi in myObject.GetType().GetProperties()) { if (pi.CanWrite) { object value = pi.GetValue(Properties, null); // if (value is not default) // { X.addAttribute(pi.Name, value); ...

In Symfony with the Doctrine ORM how do you default autoincrement columns to integer and not bigint?

It seems that in Symfony 1.4 with Doctrine that when generating auto-increment columns (id) it defaults to bigint. This seems like total overkill and I would just like to default it to an integer instead. The following produces a primary key column named id that is a bigint JobeetCategory: actAs: { Timestampable: ~ } columns: ...

Android: debug app on device with Eclipse and password-protected keystore?

I uploaded my application to Market and then downloaded it to my phone. Now I'm unable to use debug keystore which is used by default by Eclipse ADT Plugin (Re-installation failed due to different application signatures) and when I'm trying to setup own keystore in Eclipse->Windows->Android->Build->CustomDebugKeystore, I'm unable to ente...

For HTTP responses with Content-Types suggesting character data, which charset should be assumed by the client if none is specified?

If no charset parameter is specified in the Content-Type header, RFC2616 section 3.7.1 seems to imply ISO8859-1 should be assumed for media types of subtype "text": When no explicit charset parameter is provided by the sender, media subtypes of the "text" type are defined to have a default charset value of "ISO-8859-1" when r...

Override BigDecimal to_s default in Ruby

As I retrieve data from a database table an array is populated. Some of the fields are defined as decimal & money fields and within the array they are represented as BigDecimal. I use these array values to populate a CSV file, but the problem is that all BigDecimal values are by default represented in Scientific format (which is the de...

Default value for boost::function argument?

I've got a function that I want to take an optional boost::function argument as a callback for reporting an error condition. Is there some special value I can use a the default value to make it optional? For example, with a regular function pointer I can do: void my_func(int a, int b, t_func_ptr err_callback=NULL) { if (error && (...

Why isn't Python installed on Windows by default?

Or any other normal scripting language for that matter. I know there is VBScript and JScript. But I don't really like those for any kind of computing. I would really love to have python or ruby (or perl) interpreter installed with windows by default so when I write small console applications I wouldn't need to distribute whole python in...

Eclipse shortcut ctrl+m behavior

In eclipse we have the ctrl+m shortcut for maximizing windows. But when you have two editors opened side by side, it maximizes both editors. Is there anyway to change the default behavior of ctrl+m so it only maximizes one window? (Personally this is the behavior i need 9 out of 10 times using ctrl+m) Thanks. ...

Is there such a thing as a catch-all key for a javascript object?

Considering the following javascript example: var myobj = { func1: function() { alert(name in this) }, func2: function() { alert(name in this) }, func3: function() { alert(name in this) } } myobj.func2(); // returns true myobj.func4(); // undefined function Is it possible to create a 'catch-all' key ...

Java: Open default mail application and create new mail and populate To and Subject fields

Hi everyone. Just wondering if anyone can help me with a problem I've come across in Java. Is there functionality within Java to produce a section of code that will open the default email application on a user's PC? (I guess almost like a fancy mailto link...) If there is - is it possible to populate fields such as the To and Subject ...