on-internet

Oslo's Intellipad: How to set up the 3 column MGrammarMode?

I've been using Oslo for MSchema. Works great. I can write an M Schema for a database design and it generates T-SQL to build the entire db with PKs, FKs, checks for integrity etc. I've set up a .bat file to compile the .m into .mx then load it into the db, then run SqlMetal into my project and in 30 seconds I'm moving on with my changes. I love it. OK so now I'm moving on into mGrammar. I'm not quite sure how I'll incorporate it into my app but I'll figure that out. What I need first is to set up Intellipad to give me the Input/Grammar/Output triptych. I'm stumped. I can't figure out any way t

Join the discussion →

non-graphical 3-way merge tool

I currently use RCS' merge command to do 3-way merges, but one thing has always annoyed me about it. If I use the -A option, the same change made in both files shows up as a conflict: <<<<<<< file1 file1 line 1 ||||||| orig orig line 1 ======= file2 line 1 >>>>>>> file2 orig line 2 <<<<<<< orig ======= line added in both changes >>>>>>> file2 orig line 3 If I use the default (-E) then those identical changes are not shown, but then the output only shows the two contributors, not the ancestor, something like this: <<<<<<< file1 file1 line 1 ======= file2 line 1 >>>>>>> file2 orig line 2 line ad

Join the discussion →

Bitwise subtraction in Python

This is a follow-up to my question yesterday: CMS kindly provided this example of using bitwise operators to add two numbers in C: #include<stdio.h> int add(int x, int y) { int a, b; do { a = x & y; b = x ^ y; x = a << 1; y = b; } while (a); return b; } int main( void ){ printf( "6 + 3 = %d", add(6,3)); printf( "6 - 3 = %d", add(6,-3)); return 0; } It works great and I then ported it to Python as follows: def add(x, y): while True: a = x & y b = x ^ y x = a << 1 y = b if a == 0: break return b print "6 + 3 = %d" % add(6,3) print "6 - 3 = %d" % add(6,-3) They both work for addition and the C pr

Join the discussion →

Show SOME invisible/whitespace characters in Eclipse

A long while back I transitioned to doing all my web application development in Eclipse from BBEdit. But I miss one little feature from BBEdit. I used to be able to show invisible characters like tabs but not show other invisibles like spaces. I know that I can bulk turn all of these on in Eclipse, but I wonder if there is a way to show only some invisibles in Eclipse.

Join the discussion →

Interesting uses of M? [closed]

I know M is a new language from Microsoft that's targeted as a modeling solution but I'm still a bit fuzzy on usage / rationale / advantages. That's why I'm looking for interesting things that people have done with M, so I can understand it better.

Join the discussion →

Sharepoint Custom Filter Web Part

I want to create a custom web part that has more than 1 filter web part and that can be connected to Report Viewer Web Part (Integrated Mode) at runtime/design time. I searched a lot for this, but could not find a way to have single web part that is a provider to more than 1 filters. Say for example - My Report accepts 2 parameter Department and Region. I want to connect both parameters with single web part having two drop down (one for Department and one for Region) Values from both the drop down should be passed to Department and Region Report should be rendered in Report Viewer Web Part Sol

Join the discussion →

What's better for DSL: TCL or Lisp?

What's better for DSL: TCL or Lisp? What can you say about Java(C#)-TCL binding versus Lisp(Scheme)? What DSL tool is applicable for .Net development? (excepting Microsoft DSL tools)

Join the discussion →

What is the difference between equality and equivalence?

I've read a few instances in reading mathematics and computer science that use the equivalence symbol ≡, (basically an '=' with three lines) and it always makes sense to me to read this as if it were equality. What is the difference between these two concepts?

Join the discussion →

How do you set strings to uppercase / lowercase in Unicode?

This is mostly a theoretical question I'm just very curious about. (I'm not trying to do this by coding it myself or anything, I'm not reinventing wheels.) My question is how the uppercase/lowercase table of equivalence works for Unicode. For example, if I had to do this in ASCII, I'd take a character, and if it falls withing the [a-z] range, I'd sum the difference between A and a. If it doesn't fall on that range, I'd have a small equivalence table for the 10 or so accented characters plus ñ. (Or, I could just have a full equivalence array with 256 entries, most of which would be the same as

Join the discussion →

What are your favorite extension methods for C#? (codeplex.com/extensionoverflow)

Let's make a list of answers where you post your excellent and favorite extension methods. The requirement is that the full code must be posted and a example and an explanation on how to use it. Based on the high interest in this topic I have setup an Open Source Project called extensionoverflow on Codeplex. Please mark your answers with an acceptance to put the code in the Codeplex project. Please post the full sourcecode and not a link. Codeplex News: 24.08.2010 The Codeplex page is now here: http://extensionoverflow.codeplex.com/ 11.11.2008 XmlSerialize / XmlDeserialize is now Implemented a

Join the discussion →

Are there fixed size integers in GCC?

On the MSVC++ compiler, one can use the __int8, __int16, __int32 and similar types for integers with specific sizes. This is extremely useful for applications which need to work with low-level data structures like custom file formats, hardware control data structures and the like. Is there a similar equivalent I can use on the GCC compiler?

Join the discussion →

How to bind a label inside a gridview to another table?

I have a very standard Gridview, with Edit and Delete buttons auto-generated. It is bound to a tableadapter which is linked to my RelationshipTypes table. dbo.RelationshipTypes: ID, Name, OriginConfigTypeID, DestinationConfigTypeID I wish to use a label that will pull the name from the ConfigTypes table, using the OriginConfigTypeID and DestinationTypeID as the link. dbo.ConfigTypes: ID, Name My problem is, I can't automatically generate Edit and Delete buttons using an Inner Join in my dataset. Or can I? Here is my code: <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"

Join the discussion →

Explanation of Oslo error "M2037: SQL Generation Internal Error: Missing generator for variable"?

In Microsoft Oslo SDK CTP 2008 (using Intellipad) the following code compiles fine: module T { type A { Id : Integer32 = AutoNumber(); } where identity Id; As : A*; type B { Id : Integer32 = AutoNumber(); // A : A; // } where A in As && identity Id; } where identity Id; Bs : B*; type C { Id : Integer32 = AutoNumber(); B : B; } where B in Bs && identity Id; Cs : C*; } and results in the following Reach SQL output: set xact_abort on; go begin transaction; go set ansi_nulls on; go create schema [T]; go create table [T].[As] ( [Id] int not null identity, constraint [PK_As] primary key clustered ([

Join the discussion →

Explanation of Oslo error "M0197: 'Text' cannot be used in a Type context"?

In Microsoft Oslo SDK CTP 2008 (using Intellipad) the following code compiles fine: module M { type T { Text : Text; } } while compiling the below code leads to the error "M0197: 'Text' cannot be used in a Type context" module M { type T { Text : Text; Value : Text; // error } } I do not see the difference between the examples, as in the first case Text is also used in a Type context. To add to the confusion, consider the following example, which also compiles fine: module M { type X; type T { X : X; Y : X; } } The Oslo M Language Specification states that: Field declarations override lexical

Join the discussion →

Signing a Windows EXE file

I have an EXE file that I should like to sign so that Windows will not warn the end user about an application from an "unknown publisher". I am not a Windows developer. The application in question is a screensaver generated from an application that generates screensaver applications. As such I have no influence on how the file is generated. I've already found out that I will need a code signing certificate from a CA like Verisign or instantssl.com. What I don't understand is what I need to do (if at all possible) to sign my EXE file. What is a simple explanation? Mel Green's answer took me fur

Join the discussion →

What are my code signing certificate options?

I've been assigned the task of buying a digital certificate for my company to sign our code. We develop applications in the Microsoft space, mostly WPF or Web-based. I've investigated options and found Comodo to be well priced and responsive, and we're ready to go ahead and purchase a certificate through them... However, in the signup form there are various private key options that I'm not too sure about, namely: CSP Microsoft Base Cryptographic Provider Microsoft Base Smart Card Crypto Provider Microsoft Enhanced Cryptographic Provider v1.0 Microsoft Software Cryptographic Provider Key Size 1

Join the discussion →

What are the correct version numbers for C#?

What are the correct version numbers for C#? What came out when? Why can't I find any answers about C# 3.5? This question is primarily to aid those who are searching for an answer using an incorrect version number, e.g. C# 3.5. The hope is that anyone failing to find an answer with the wrong version number will find this question and then search again with the right version number.

Join the discussion →

How to add a progress bar to a shell script?

When scripting in bash or any other shell in *NIX, while running a command that will take more than a few seconds, a progress bar is needed. For example, copying a big file, opening a big tar file. What ways do you recommend to add progress bars to shell scripts?

Join the discussion →

How do I repair an InnoDB table?

We (apparently) had poorly executed of our Solaris MySQL database engine last night. At least some of the InnoDB tables are corrupted, with timestamp out of order errors in the transaction log, and a specific error about the index being corrupted. We know about the tools available for MyISAM table repairs, but cannot find anything for InnoDB. Side note: attempting a table optimize (in my attempt to rebuild the corrupted index) causes the database server to crash.

Join the discussion →

How to get options in the order entered by the user, using Getopt::Long?

I have an existing Perl program that uses Getopt package and Getopt::Long::Configure with permute as one of the options. However, now I need to keep the order of the options entered by the user. There is an option $RETURN_IN_ORDER mentioned in the Long.pm file, however it doesn't seem to be used anywhere at all. When I pass return_in_order, I am getting the following error. Getopt::Long: unknown config parameter "return_in_order" at C:/Program Files/IBM/RationalSDLC/common/lib/perl5/5.8.6/Getopt/Long.pm line 1199. Can someone please tell me if this is supported at all and if so, the right way

Join the discussion →

What should main() return in C and C++?

What is the correct (most efficient) way to define the main() function in C and C++ — int main() or void main() — and why? And how about the arguments? If int main() then return 1 or return 0?

Join the discussion →

C# event handling (compared to Java)

I am currently having a hardtime understanding and implementing events in C# using delagates. I am used to the Java way of doing things: Define an interface for a listener type which would contain a number of method definitions Define adapter class for that interface to make things easier if I'm not interested in all the events defined in a listener Define Add, Remove and Get[] methods in the class which raises the events Define protected fire methods to do the dirty work of looping through the list of added listeners and calling the correct method This I understand (and like!) - I know I coul

Join the discussion →

grid controls for ASP.NET MVC? [closed]

If you are using ASP.NET MVC how are you doing grid display? Rolled your own? Got a library from somewhere? These are some of the known grid display solutions I have found for ASP.NET MVC ASP.NET MVC Flexgrid - Has nice column layout method Code based ASP.NET MVC GridView - simple, small, clean MVC Contrib - grid from codePlex jQueryGrid - jQuery grid Datatables - jQuery plugin - believed to be section 508 compliant (.NET binding) extJS - cross browser RIA framework - has grid support Ingrid - jQuery data grid jqxGrid - jQuery data grid Telerik MVC - jQuery based grid that is GPL v2 licensed,

Join the discussion →

Forcing single-argument constructors to be explicit in C++

By default, in C++, a single-argument constructor can be used as an implicit conversion operator. This can be suppressed by marking the constructor as explicit. I'd prefer to make "explicit" be the default, so that the compiler cannot silently use these constructors for conversion. Is there a way to do this in standard C++? Failing that, is there a pragma (or similar) that'll work in Microsoft C++ to do this? What about g++ (we don't use it, but it might be useful information)?

Join the discussion →

What's the difference between an argument and a parameter?

When verbally talking about methods, I'm never sure whether to use the word argument or parameter or something else. Either way the other people know what I mean, but what's correct, and what's the history of the terms? I'm a C# programmer, but I also wonder whether people use different terms in different languages. For the record I'm self-taught without a background in Computer Science. (Please don't tell me to read Code Complete because I'm asking this for the benefit of other people who don't already have a copy of Steve McConnell's marvelous book.)

Join the discussion →
Older stories