Daily Archives

Articles indexed Friday April 30 2010

Page 3/114 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Writing A Transact SQL (TSQL) Procedure For SQL Server 2008 To Delete Rows From Table Safely

    In this post, we will show and explain a small TSQL Sql Server 2008 procedure that deletes all rows in a table that are older than some specified date.  That is, say the table has 10,000,000 rows in it the accumulated over the past 2 years.  Say you want to delete all but [...]...Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • using jquery to disable a series of radio buttons on demand.

    - by holden
    I'm trying to accomplish something similar to Wikipedia's History history page, dynamically disabling radio buttons in a series. Ie... if #4 in group two is selected, then 1-4 of group one are disabled, etc. I know how to disable them individually or as a group, but I'm not sure how to do it in a series of say 1-4: Individually: $("#version_history input[id^=versions_2_3]:radio").attr('disabled',true); or group: $("#version_history input[id^=versions_2]:radio").attr('disabled',true); The inputs are named versions_1_X and versions_2_X, X being some number. 1..2..3.. etc.

    Read the article

  • Regex to extract a string between two delimeters WITHOUT also returning the delimeters?

    - by CSharp Noob
    Hello, I want to just extract the text between the brackets -- NOT the brackets, too! My code looks currently like this: var source = "Harley, J. Jesse Dead Game (2009) [Guard]" // Extract role with regex m = Regex.Match(source, @"[(.*)]"); var role = m.Groups[0].Value; // role is now "[Guard]" role = role.Substring(1, role.Length-2); // role is now "Guard" Can you help me to simplify this to just a single regex, instead of the regex, then the substring?

    Read the article

  • How to format a function pointer?

    - by Longpoke
    Is there any way to print a pointer to a function in ANSI C? Of course this means you have to cast the function pointer to void pointer, but it appears that's not possible?? #include <stdio.h> int main() { int (*funcptr)() = main; printf("%p\n", (void* )funcptr); printf("%p\n", (void* )main); return 0; } $ gcc -ansi -pedantic -Wall test.c -o test test.c: In function 'main': test.c:6: warning: ISO C forbids conversion of function pointer to object pointer type test.c:7: warning: ISO C forbids conversion of function pointer to object pointer type $ ./test 0x400518 0x400518 It's "working", but non-standard...

    Read the article

  • Java: conditional initialization?

    - by HH
    Ruby has conditional initialization. Apparently, Java does not or does it? I try to write more succintly, to limit the range as small as possible. import java.io.*; import java.util.*; public class InitFor{ public static void main(String[] args){ for(int i=7,k=999;i+((String h="hello").size())<10;i++){} System.out.println("It should be: hello = "+h); } } Errors Press ENTER or type command to continue InitFor.java:8: ')' expected for(int i=7,k=999;i+((String h="hello").size())<10;i++){} ^

    Read the article

  • are projects with high developer turn over rate really a bad thing?

    - by John
    I've inherited a lot of web projects that experienced high developer turn over rates. Sometimes these web projects are a horrible patchwork of band aid solutions. Other times they can be somewhat maintainable mozaics of half-done features each built with a different architectural style. Everytime I inherit these projects, I wish the previous developers could explain to me why things got so bad. What puzzles me is the reaction of the owners (either a manager, a middle man company, or a client). They seem to think, "Well, if you leave, I'll just find another developer." Or they think, "Oh, it costs that much money to refactor the system? I know another developer who can do it at half the price. I'll hire him if I can't afford you." I'm guessing that the high developer turn over rate is related to the owner's mentality of "If you think it's a bad idea to build this, I'll just find another (possibly cheaper) developer to do what I want". For the owners, the approach seems to work because their business is thriving. Unfortunately, it's no fun for the developers that go AWOL 3-4 months after working with poor code, strict timelines, and little feedback. So my question is the following: Are the following symptoms of a project really such a bad thing for business? high developer turn over rate poorly built technology - often a patchwork of different and inappropriately used architectural styles owners without a clear roadmap for their web project, and they request features on a whim I've seen numerous businesses prosper while experiencing the symptoms above. So as a programmer, even though my instincts tell me the above points are terrible, I'm forced to take a step back and ask, "are things really that bad in the grand scheme of things?" If not, I will re-evaluate my approach to these projects.

    Read the article

  • May we have Ruby and Rails performance statistics? We're persuading the business to use Rails!

    - by thekingoftruth
    We're convincing our Products officer that we want to use JRuby on Rails, and we're having a hard time coming up with some statistics which show that: Coding time is less using Rails vs. say Struts or Zend Framework or what have you. Ruby (and JRuby in particular) performance isn't horrible (anymore). Rails performance isn't bad either. If you can get us some good stats quickly, we might have a chance!

    Read the article

  • shell script fun! performing action on each subdirectory from a given path

    - by pocketfullofcheese
    I am writing a shell script (which I suck at) and I need some help. Its a script that is moving things from git to CVS (not important). The thing is, i a file path: controllers/listbuilder/setup/SubmissionRolesListbuilderHandler.inc.php and I need to be able to do: cvs add controllers; cvs add controllers/listbuilder; cvs add controllers/listbuilder/setup; cvs add controllers/listbuilder/setup/SubmissionRolesListbuilderHandler.inc.php Can someone help me out? The best I've come up with so far is to recursively add ALL files in my working tree, but that seems overly inefficient.

    Read the article

  • Circular reference fix?

    - by SXMC
    Hi! I have a Player class in a separate unit as follows: TPlayer = class private ... FWorld: TWorld; ... public ... end; I also have a World class in a separate unit as follows: TWorld = class private ... FPlayer: TPlayer; ... public ... end; I have done it this way so that the Player can get data from the world via FWorld, and so that the other objects in the world can get the player data in a similar manner. As you can see this results in a circular reference (and therefore does not work). I have read that this implies bad code design, but I just can't think of any better other way. What could be a better way to do it? Cheers!

    Read the article

  • Friend WithEvents in VB vs private in C#

    - by serhio
    Hello, friends Who knows, why in vb.net WinForm projects the designer by default use the Friend WithEvents attributes and in C# - private ones. By ex, in a form.designer. .cs private Label Label1; .vb Friend WithEvents Label1 as Label; For WithEvents is more or less clear(for using Handles, apparently). But why Friend in VB and private in C#... Thanks.

    Read the article

  • DIBI slides

    I have posted my DIBI slides (PDF; 1,8Meg). It was a fun conference, and my presentation went well. Web developers clearly want to know about mobile. The talks also seem to have been broadcast and taped; will let you know......Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • Assigning a value to a variable gets stored in the wrong spot?

    - by scribbloid
    Hello, I'm relatively new to C, and this is baffling me right now. It's part of a much larger program, but I've written this little program to depict the problem I'm having. #include <stdio.h> int main() { signed int tcodes[3][1]; tcodes[0][0] = 0; tcodes[0][1] = 1000; tcodes[1][0] = 1000; tcodes[1][1] = 0; tcodes[2][0] = 0; tcodes[2][1] = 1000; tcodes[3][0] = 1000; tcodes[3][1] = 0; int x, y, c; for(c = 0; c <= 3; c++) { printf("%d %d %d\r\n", c, tcodes[c][0], tcodes[c][1]); x = 20; y = 30; } } I'd expect this program to output: 0 0 1000 1 1000 0 2 0 1000 3 1000 0 But instead, I get: 0 0 1000 1 1000 0 2 0 20 3 20 30 It does this for any number assigned to x and y. For some reason x and y are overriding parts of the array in memory. Can someone explain what's going on? Thanks!

    Read the article

  • Putting a MovieMaterial behind a DAE model in Papervision3D

    - by didibus
    Hi, I'm doing a project using FLARManager augmented reality and the Papervision3D library. Unfortunately, Papervision is giving me a lot of problems. My scene3D contains a DAE model and a plane. The plane has a MovieMaterial and is playing a video through FLVPlayback. The DAE and the plane are both inside the same DisplayObject3D container. FLARManager transforms the container so that everything appears through the angle of the marker. My DAE model is a TV, the screen of the TV is transparent. I want to have my Plane inside of my DAE model, so that the Movie playing on the plane material appears to be what is playing on the TV. The problem is that, even if the plane has a lower Z index then the TV, it always appears in front of the TV. How do I have my plane and its MovieMaterial appear behind the TV, so that some of its corners are cut out by the TV and the part of the TV thats transparent let me see the Movie? If its impossible, anyone has an idea of how I could get the desired effect of having a movie play on the screen of my DAE tv model? Thank You.

    Read the article

  • How do I write test code to exercise a C# generic Pair<TKey, TValue> ?

    - by Scott Davies
    Hi, I am reading through Jon Skeet's "C# in Depth", first edition (which is a great book). I'm in section 3.3.3, page 84, "Implementing Generics". Generics always confuse me, so I wrote some code to exercise the sample. The code provided is: using System; using System.Collections.Generic; public sealed class Pair<TFirst, TSecond> : IEquatable<Pair<TFirst, TSecond>> { private readonly TFirst first; private readonly TSecond second; public Pair(TFirst first, TSecond second) { this.first = first; this.second = second; } ...property getters... public bool Equals(Pair<TFirst, TSecond> other) { if (other == null) { return false; } return EqualityComparer<TFirst>.Default.Equals(this.First, other.First) && EqualityComparer<TSecond>.Default.Equals(this.Second, other.Second); } My code is: class MyClass { public static void Main (string[] args) { // Create new pair. Pair thePair = new Pair(new String("1"), new String("1")); // Compare a new pair to previous pair by generating a second pair. if (thePair.Equals(new Pair(new string("1"), new string("1")))) System.Console.WriteLine("Equal"); else System.Console.WriteLine("Not equal"); } } The compiler complains: "Using the generic type 'ManningListing36.Paie' requires 2 type argument(s) CS0305" What am I doing wrong ? Thanks, Scott

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >