code

Scholarships for open-source code?

So I'm attending college in the fall, thus my dad won't be quiet about the scholarship thing. I've wrote two wordpress plugin and a jQuery plugin, so I was wondering if there are any legit scholarships I could enter because of these? Thanks for any advice =D ...

Ruby: String no longer mixes in Enumerable in 1.9

So how can I still be able to write beautiful code such as: 'im a string meing!'.pop Note: str.chop isn't suffecient answer ...

What is the accepted definition of a code smell?

I realise this could be "very subjective", but I have asked different people from many work places who are used to different languages and ideologies what a code smell is, and noone can agree what a code smell is. It would be good to get a definition that most people can agree on. For example, what one developer calls a code smell, anot...

Convert code from Lisp to F#

I have the following code in Lisp: (defun Is_List_Even (lista) (cond ((null lista) t) ((null (cadr lista)) nil) (t (Is_List_Even (cddr lista))))) Can someone help me to write in F#? I'm new to F# and I'm in a hurry. Regards, Voicu. ...

Include or Exclude existing files/directories from current solution

Hi thr..How can i include or exclude existing files/directories from current solution in c sharp through code.. ...

Test results and code coverage status on LCD Screen

HI, We are a small TDD team. We have a LCD screen mounted on the wall which we would like to have display the status of our builds together with current code coverage. Are there any tools that will provide this out ot the box? If not is this pretty straight forward to develop on our own? We are using TFS 2008. Cheers! ...

Writing better Ruby: How to cast a objects to false or true?

In ruby, what is the best/most-elegant way to return a value such as: #method returns true or false if 'do i match' is present in string def method(str) str =~ /do i match/ end ...

Text Macros in XCode not working?

Noob xcoder here and for some reason i cannot get the text macros to expand within xcode. For example if i type ifelse and then hit ^. it doesnt automatically expand the macro?? Likewise if i type fo and then ^. it will complete it to either for,fori etc, and will also pop up those options if i hit escape however i cannot get it to expan...

Replace javascript on a site with Greasemonkey

Hello, does anyone know how to replace JavaScript on a site with Greasemonkey ie. This is the default code: var Test="1"; And i want to replace it like this on the page load: var Test="2"; Thanks in advance! ...

Form object question

Does anyone have any hard and fast rules about what kind of code the form object should handle as opposed to letting the object itself handle it? For example, if there is a race, should the object that is racing say, horses, handle the race as part of being a horse, or is it better to place that inside the form object? I guess what I'm a...

Need C# Source Code relational diagram

I recently took over a web application project written in Visual Studio 2008, C#. There was very little documentation from the previous guy. I know it uses master pages and the starting page is default.aspx. Although it may still be possible to trace the code manually (through LOTS of time and hard labor and still some more), I believe I...

How can I make use of Visual Studio's regular expression to replace multiple lines of code?

Is it possible to make use of Visual Studio 2005/2008 "Find" and "Replace" functionality along with regular expression to replace multiple lines of already coded C# code into a single line of code? Note that Visual Studio's "Find" and "Replace" regular expression syntax differs from .NET Framework. ...

How can we do packet marking (TOS, identifier, flag fields) for IP address using java code

use of TOS, identifier, flag fields for IP address using java code for deterministic packet marking ...

Would a regex like this work for these lines of text?

Regex: String regexp = "([0-9.]{1,15})[ \t]*([0-9]{1,15})[ \t]*([0-9.]{1,15})[ \t]*(\"(.*?)\"\\s+\\((\\d{4})\\)\\s+\\{(.*?)\\})"; Text: 1000000103 50 4.5 #1 Single (2006) 2...1.2.12 8 2.7 $1,000,000 Chance of a Lifetime (1986) 11..2.2..2 8 5.0 $100 Taxi Ride (2001) ....13.311 9 7.1 $100,000 Name Th...

How can I fail Maven build if exec:java goal fails?

We're using the Maven exec:java goal to run a custom java application that configures a database for use with our integration tests. We want to use exec:java over exec:exec to be able to use the project dependencies in the classpath of the main class to be used. A few times the application has failed for valid reasons, but the Maven buil...

Where is the leak here?

-(IBAction)gameplayButtonClicked{ GamePlayViewController *screen3 = [[GamePlayViewController alloc] initWithNibName:nil bundle:nil]; screen3.modalTransitionStyle = UIModalTransitionStyleCrossDissolve; [self presentModalViewController:screen3 animated:YES]; [screen3 release]; } ...

Automatically go to a Class in eclipse from Instance

Is there a way to automatically go to a Class in eclipse from an instance of it. Foo foo = new Foo(); // lots of lines of code foo.some(); // from foo I want to go to the Class Foo direcly with a key press. I received some answers but that is not what I was looking for. Sometime I don't call a method, I just have reference foo only...

C: Convert A ? B : C into if (A) B else C

I was looking for a tool that can convert C code expressions for the form: a = (A) ? B : C; into the 'default' syntax with if/else statements: if (A) a = B else a = C Does someone know a tool that's capable to do such a transformation? I work with GCC 4.4.2 and create a preprocessed file with -E but do not want such structures...

Deleting a node in a circular linked list c++?

EDITED: using c++ to code. void circularList::deleteNode(int x) { node *current; node *temp; current = this->start; while(current->next != this->start) { if(current->next->value == x) { temp = current->next; current->next = current->next->next; delete current->next...

.NET/C#: How to remove/minimize code clutter while 'triggering' Events

Hi, I just wanna find out if there's a way I could minimize code clutter in my application. I have written code/s similar to this: private void btnNext_MouseEnter(object sender, System.Windows.Input.MouseEventArgs e) { btnNext.Opacity = 1; } private void btnNext_MouseLeave(object sender, System.Windows.Input.Mo...