How time flies! It was about five years ago that we launched Google Code to the world. When we launched Google Code, we wanted to make code.google.com a...
ODI supports conditional branching at execution time in its code generation framework. This is a little used, little known, but very powerful capability - this let's one piece of template code behave dynamically based on a runtime variable's value for example. Generally knowledge module's are free of any variable dependency. Using variable's within…
We sit down with Zac Harlen and talk about Iowa Code Camp, what makes up a Code Camp, and how to start your own Code Camp. Zac has been a part of the leadership team for a few years for Iowa Code Camp and is the Development Manager for JP Cycles. We also get into what it takes to speak at a Code Camp if you are interested in growing beyond the user…
I have a c++ source code that was written in linux/unix environment by some other author.
It gives me errors when i compile it in windows vista environment. I am using Bloodshed Dev C++ v 4.9. please help.
#include <iostream.h>
#include <map>
#include <vector>
#include <string>
#include <string.h>
#include…
What are your thoughts on code that looks like this:
public void doSomething()
{
try
{
// actual code goes here
}
catch (Exception ex)
{
throw;
}
}
The problem I see is the actual error is not handled, just throwing the exception in a different place. I find it more difficult to debug because i…
There’s nothing quite as satisfying as the smooth and crisp action of a well built keyboard. If you’re tired of mushy keys and cheap feeling keyboards, a well-constructed mechanical keyboard is a welcome respite from the $10 keyboard that came with your computer. Read on as we put the CODE mechanical keyboard through the paces.…
One cool addition to Visual Studio 2010 is support for code contracts. Code contracts make sure that all conditions under what method is supposed to run correctly are met. Those who are familiar with unit tests will find code contracts easy to use. In this posting I will show you simple example about static contract checking (example…
I have a query that returns a lot of data into a CSV file. So much, in fact, that Excel can't open it - there are too many rows. Is there a way to control spool to spool to a new file everytime 65000 rows have been processed? Ideally, I'd like to have my output in files named in sequence, such as large_data_1.csv, large_data_2.csv,…
An word is an anagram if the letters in that word can be re-arranged to form a different word.
Task:
Find all sets of anagrams given a word list
Input:
a list of words from stdin with each word separated by a new line
e.g.
A
A's
AOL
AOL's
Aachen
Aachen's
Aaliyah
Aaliyah's
Aaron
Aaron's
Abbas
Abbasid
Abbasid's
Output:
All…
I have several CA1704:IdentifiersShouldBeSpelledCorrectly warnings that I want to suppress. Basically they refer to the company name which is deemed to be spelled incorrectly. The company name is part of several namespaces in my project, and in order to suppress all the warnings I need to add a lot of suppressions to the…
My newest project that I'm looking to build with CodeIgniter would require some sort of system that would allow a user to drag and drop pre-defined functions/methods into mini-classes/objects and then run/test them in the browser.
So it'd something similar to Scratch. I've designed a relational database that I think…
I have written a class that will handle internal logging in my application.
Now I want to use this class in another new and totally separate project.
I could simply copy the file to the new project folder, but I would like to only have one copy of it to maintain so that all changes in it will apply to both projects…
This is inspired by/taken from this thread: http://www.allegro.cc/forums/thread/603383
The Problem
Assume the user gives you a numeric input ranging from 1 to 7. Input should be taken from the console, arguments are less desirable.
When the input is 1, print the following:
***********
*********
******* …
Although I have marked my ID column with .Identity(), the generated database schema doesn't have IDENTITY set to true, which gives me problems when I'm adding records. If I manually edit the database schema (in SQL Management Studio) to have the Id column marked IDENTITY, everything works as I want it - I just can't…
Hi-
I'm trying to use an external library DevExpress.XtraTreeList.v8.1.dll in my vsto office addin built using VS2010 beta 2. I am getting the following compile time error:
DevExpress.Utils.AppareanceObject threw an exception -- System.NotSupportedException.
The error message goes on to say that for…
What is the shortest way, by character count, to find prime factors in any number?
Example Input: 1806046
Example Output: 2x11x11x17x439
Example Calculator
Can you figure out the numeric equivalent of an Excel column string in the shortest-possible way, using your favorite language? For example, the A column is 1, B is 2, so on and so forth. Once you hit Z, the next column becomes AA, then AB and so on.
Rules:
Here is some sample input and output:
A: 1…
I've inherited a project where all the private variables, and there are thousands, are separated by a blank line. For instance,
private pnlSecurityReport _pnlSecurityReport = null;
private pnlCalendar _pnlCalendar = null;
private CtlContacts _pnlContacts = null;
private pnlEmails…
I'll start by quoting google's blog
Project owners can now create multiple repositories for their project, and they can choose to make any of those new repositories a clone of any of the project's other repositories. These project clones share the same commit access permissions as the original…
I have converted my Datatable to json string use the following method...
public string GetJSONString(DataTable Dt)
{
string[] StrDc = new string[Dt.Columns.Count];
string HeadStr = string.Empty;
for (int i = 0; i < Dt.Columns.Count; i++)
{
StrDc[i] =…
In .NET WinForms I want to display message in a status bar and suspend the program execution until user moves mouse or presses keyboard. How can I do that?