instruction
stringlengths
0
30k
In C#, what is the best way to test if a dataset is empty?
|c#|.net|
I know you can look at the row.count, but are there other ways to tell if a dataset is empty?
I know you can look at the row.count or tables.count, but are there other ways to tell if a dataset is empty?
You can use the WMI query language for that. Take a look at <http://msdn.microsoft.com/en-us/library/aa394592(VS.85).aspx> for examples. The information you are looking for is available e.g. through the property VolumeName of the Win32_LogicalDisk class, <http://msdn.microsoft.com/en-us/library/aa394173(VS.85).aspx> <code>SELECT * FROM Win32_LogicalDisk WHERE VolumeName="MyLabel"</code>
You can do this with the [Microsoft Loopback Adapter][1] which is a driver for a virtual network card. [1]: http://support.microsoft.com/kb/839013
This bat file will give you the drive letter from a drive label: Option Explicit Dim num, args, objWMIService, objItem, colItems set args = WScript.Arguments num = args.Count if num <> 1 then WScript.Echo "Usage: CScript DriveFromLabel.vbs <label>" WScript.Quit 1 end if Set objWMIService = GetObject("winmgmts:\\.\root\cimv2") Set colItems = objWMIService.ExecQuery("Select * from Win32_LogicalDisk") For Each objItem in colItems If strcomp(objItem.VolumeName, args.Item(0), 1) = 0 Then Wscript.Echo objItem.Name End If Next WScript.Quit 0 Run it as: cscript /nologo DriveFromLabel.vbs label
Upgrade database from SQL Server 2000 to 2005 -- and rebuild full-text indexes?
|sql-server|full-text-search|recovery|
I'm loading a SQL Server 2000 database into my new SQL Server 2005 instance. As expected, the full-text catalogs don't come with it. How can I rebuild them? Right-clicking my full text catalogs and hitting "rebuild indexes" just hangs for hours and hours without doing anything, so it doesn't appear to be that simple...
Unix has a 'fork' system call which 'splits' the current process into two, and gives you a second process that is identical to the first (modulo the return from the fork call). Since the address space of the new process is already up and running this is should be cheaper than calling 'CreateProcess' in Windows and having it load the exe image, associated dlls, etc. In the fork case the OS can use 'copy-on-write' semantics for the memory pages associated with both new processes to ensure that each one gets their own copy of the pages they subsequently modify.
* quirksmode.org has an [overview of various methods][1]. * There's a related SO question: ["In HTML, how to word-break on a dash?"][2] * In browsers that support it, [`word-wrap: break-word`][3] might give the desired effect as well. [1]: http://www.quirksmode.org/oddsandends/wbr.html [2]: http://stackoverflow.com/questions/904/in-html-how-to-word-break-on-a-dash [3]: http://www.w3.org/TR/css3-text/#word-wrap
I find that the .NET event model is such that I'll often be raising an event on one thread and listening for it on another thread. I was wondering what the cleanest way to marshal an event from a background thread onto my UI thread is. Currently I use code like this: delegate void CoolObject_CoolEventCallback( object sender, UpdateManagerEventArgs e); private void mCoolObject_CoolEvent(object sender, CoolObjectEventArgs args) { if (InvokeRequired) { CoolObject_CoolEventCallback cb = new CoolObject_CoolEventCallback( mCoolObject_CoolEvent); BeginInvoke(cb, new object[] { sender, args }); return; } // do the dirty work of my method here }
I find that the .NET event model is such that I'll often be raising an event on one thread and listening for it on another thread. I was wondering what the cleanest way to marshal an event from a background thread onto my UI thread is. Based on the community suggestions, I've used this: // earlier in the code mCoolObject.CoolEvent+= new CoolObjectEventHandler(mCoolObject_CoolEvent); // then private void mCoolObject_CoolEvent(object sender, CoolObjectEventArgs args) { if (InvokeRequired) { CoolObjectEventHandler cb = new CoolObjectEventHandler( mCoolObject_CoolEvent); Invoke(cb, new object[] { sender, args }); return; } // do the dirty work of my method here }
PowerShell - How do I pass string parameters correctly?
|string|powershell|parameters|arguments|
Is there documentation or an article on the rules for passing strings into PowerShell functions? I just trying to do some string concatenation/formatting, but it's putting all the parameters into the first placeholder. **Code** function CreateAppPoolScript([string]$AppPoolName, [string]$AppPoolUser, [string]$AppPoolPass) { # Command to create an IIS application pool $AppPoolScript = "cscript adsutil.vbs CREATE ""w3svc/AppPools/$AppPoolName"" IIsApplicationPool`n" $AppPoolScript += "cscript adsutil.vbs SET ""w3svc/AppPools/$AppPoolName/WamUserName"" ""$AppPoolUser""`n" $AppPoolScript += "cscript adsutil.vbs SET ""w3svc/AppPools/$AppPoolName/WamUserPass"" ""$AppPoolPass""`n" $AppPoolScript += "cscript adsutil.vbs SET ""w3svc/AppPools/$AppPoolName/AppPoolIdentityType"" 3" return $AppPoolScript } $s = CreateAppPoolScript("name", "user", "pass") write-host $s **Output** cscript adsutil.vbs CREATE "w3svc/AppPools/name user pass" IIsApplicationPool cscript adsutil.vbs SET "w3svc/AppPools/name user pass/WamUserName" "" cscript adsutil.vbs SET "w3svc/AppPools/name user pass/WamUserPass" "" cscript adsutil.vbs SET "w3svc/AppPools/name user pass/AppPoolIdentityType" 3
I'm not a database expert, and I do not speak from experience. However: [MyISAM tables use table-level locking][1]. Based on your traffic estimates, you have close to 200 writes per second. With MyISAM, *only one of these could be in progress at any time*. You have to make sure that your hardware can keep up with these transaction to avoid being overrun, i.e., a single query can take no more than 5ms. That suggests you me you would need a storage engine which supports row-level locking, i.e., InnoDB. On the other hand, it should be fairly trivial to write a few simple scripts to simulate the load with each storage engine, then compare the results. [1]: http://dev.mysql.com/doc/refman/5.1/en/internal-locking.html
I thought most of the virus scanners nowadays use [*sandbox techniques*][1] to check for "bad" behavior. Therefore the polymorphic virusses will also be detected. of course these detection techniques are also known to virus creators, and can easily be bypassed using a bunch of random, unharmfull, code executions before the actual payload. [1]: http://www.norman.com/Virus/Sandbox/20374/en
There is another place where the TNS location is stored: If you're using Windows, open <code>regedit</code> and navigate to <code>My HKEY Local Machine/Software/ORACLE/KEY_OraClient10_home1</code> where <code>KEY_OraClient10_home1</code> is your Oracle home. If there is a string entry called <code>TNS_ADMIN</code>, then the value of that entry will point to the TNS file that Oracle is using on your computer.
Perhaps you could use an XSL transformation to convert the XSD into SQL table definitions. Likewise, I can't find any prior examples of this, but I'd have thought it would be possible. I'd imagine a generic XSLT for XSD->SQL, once written, could be applied to any such scenario (and would be cross-platform too). Perhaps somebody has done this before...
Note that djvu is an image compression format (optimized to compress 'pictures of text', typically the results of scanning). As such, you won't be able to search for text, except in the metadata -this is what the link sent by cdleary refers to-, *or* if you first use OCR on the document to convert it into text. The same is true for PDFs which content are scanned articles/books.
WP-Syntax uses GeSHi to do the highlighting, the WordPress Syntax Highlighter uses the [Javascript SyntaxHighlighter][1] [1]: http://code.google.com/p/syntaxhighlighter/wiki/Overview
The "Official" Java API for this is now JAXB - Java API for XML Binding. The reference implementation lives at [https://jaxb.dev.java.net/][1] [1]: https://jaxb.dev.java.net/
B.name is a class attribute, not an instance attribute. It shows up in B.\__dict__, but not in b = B(); b.\__dict__. The distinction is obscured somewhat because when you access an attribute on an instance, the class dict is a fallback. So in the above example, b.name will give you the value of B.name.
I believe that os.system just invokes whatever command shell is configured for the user, so I don't think you can do it in a platform independent way. My command shell could be anything from bash, emacs, ruby, or even quake3. Some of these programs aren't expecting the kind of arguments you are passing to them and even if they did there is no guarantee they do their escaping the same way.
Get a list of current windows, and give one of them focus, in .Net
|.net|windows|
Without resorting to PInvoke, is there a way in .net to find out what windows are open? This is slightly different than asking what applications are running in memory. For example, Firefox could be running, but could be more than one window. Basically, I just want to be privy to the same information that the taskbar (and alt-tab?) is. Also, once I have a reference to a window, is there any way to programatically give it focus? Is there any way to do this with managed code?
This book may prove useful: http://www.semantics.org/cpp_gotchas/
For an embedded database, you can use [SQL Server Compact Edition][1]. Unlike SQL Server Express, it is *not* compatible with the LINQ to SQL designer, but it is fully compatible with the command-line SQLMetal. It has a few advantages over SQL Express, like to ability to use embedded or run from a file. Microsoft has a very handy chart outlining the [differences between Express and Compact][2]. [1]: http://www.microsoft.com/sql/editions/compact/default.mspx [2]: http://www.microsoft.com/sql/editions/compact/sscecomparison.mspx
[This web page by Scott Wheeler][1] covers some of the main C++ pitfalls. [1]: http://developer.kde.org/~wheeler/cpp-pitfalls.html
I'd look into [Windows Distributed File System][1]. It should be supported by both Windows Server 2003 & 2008. [1]: http://www.microsoft.com/windowsserver2003/techinfo/overview/dfs.mspx
G'day, I assume that you've done your bind using INADDR_ANY to specify the address. If this is the case, then the semantics of INADDR_ANY is such that a UDP socket is created on the port specified on all of your interfaces. The socket is going to get all packets sent to all interfaces on the port specified. When sending using this socket, the lowest numbered interface is used. The outgoing sender's address field is set to the IP address of the outgoing interface used. HTH. cheers, Rob
G'day, I assume that you've done your bind using INADDR_ANY to specify the address. If this is the case, then the semantics of INADDR_ANY is such that a UDP socket is created on the port specified on all of your interfaces. The socket is going to get all packets sent to all interfaces on the port specified. When sending using this socket, the lowest numbered interface is used. The outgoing sender's address field is set to the IP address of that first outgoing interface used. First outgoing interface is defined as the sequence when you do an ifconfig -a. It will probably be eth0. HTH. cheers, Rob
@Martin >> VB6 had a "With/End With" statement that worked "like" the Using() statement in C#.NET. And of course, the less global things you have, the better for you. With/End With does not working like the Using statement, it doesn't "Dispose" at the end of the statement. With/End With works in VB 6 just like it does in VB.Net, it is basically a way to shortcut object properties/methods call. e.g. With aCustomer .FirstName = "John" .LastName = "Smith" End WIth
[DrJava][1] is your best bet. It also has an [Eclipse plugin][2] to use the interactions pane like GroovyConsole. [1]: http://www.drjava.org/ [2]: http://www.drjava.org/eclipse.shtml
The question also arises how to get the data into the BLOB. You can put the data in an INSERT statement, as the PHP example shows (although you should use [mysql_real_escape_string][2] instead of addslashes). If the file exists on the database server, you can also use MySQL's [LOAD_FILE][1] [1]: http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_load-file "LOAD FILE" [2]: http://www.php.net/mysql-real-escape-string
Parallelisation aside, you don't want to be calculating sqrt(Until) on every iteration. You also can assume multiples of 2, 3 and 5 and only calculate for N%6 in {1,5} or N%30 in {1,7,11,13,17,19,23,29}. You should be able to parallelize the factoring algorithm quite easily, since the Nth stage only depends on the sqrt(n)th result, so after a while there won't be any conflicts. But that's not a good algorithm, since it requires lots of division. You should also be able to parallelize the sieve algorithms, if you have writer work packets which are guaranteed to complete before a read. Mostly the writers shouldn't conflict with the reader - at least once you've done a few entries, they should be working at least N above the reader, so you only need a synchronized read fairly occasionally (when N exceeds the last synchronized read value). You shouldn't need to synchronize the bool array across any number of writer threads, since write conflicts don't arise (at worst, more than one thread will write a true to the same place). The main issue would be to ensure that any worker being waited on to write has completed. In C++ you'd use a compare-and-set to switch to the worker which is being waited for at any point. I'm not a C# wonk so don't know how to do it that language, but the Win32 InterlockedCompareExchange function should be available. You also might try an actor based approach, since that way you can schedule the actors working with the lowest values, which may be easier to guarantee that you're reading valid parts of the the sieve without having to lock the bus on each increment of N. Either way, you have to ensure that all workers have got above entry N before you read it, and the cost of doing that is where the trade-off between parallel and serial is made.
If its only for word processing, then perhaps [DocBook](http://en.wikipedia.org/wiki/DocBook) might be a little lighter than ODF? However, the wiki entry states: > DocBook is a semantic markup language for technical documentation. It was originally intended for writing technical documents related to computer hardware and software but it can be used for any other sort of documentation. So it might not be so suitable for a general-purpose word-processor? The advantage of using DocBook would be the fact that a number of DocBook -> other format converters should be available? Hope this helps.
For organization, use namespaces as already stated. For global data I like to use the [singleton][1] pattern because it helps with the problem of the unknown initialization order of static objects. In other words, if you use the object as a singleton it is guaranteed to be initialized when its used. Also be sure that your static functions are stateless so that they are thread safe. [1]: http://en.wikipedia.org/wiki/Singleton_pattern
2 options spring to mind. 1 is using generics: abstract class Vehicle<TAxle> where TAxle : Axle { public List<TAxle> Axles; } The second uses shadowing - and this assumes you have properties: abstract class Vehicle { public IList<Axle> Axles { get; set; } } class Motorcyle : Vehicle { public new IList<MotorcycleAxle> Axles { get; set; } } class Car : Vehicle { public new IList<CarAxle> Axles { get; set; } } void Main() { Vehicle v = new Car(); // v.Axles is IList<Axle> Car c = (Car) v; // c.Axles is IList<CarAxle> // ((Vehicle)c).Axles is IList<Axle> The problem with shadowing is that you have a generic List. Unfortunately, you can't constrain the list to only contain CarAxle. Also, you can't cast a List&lt;Axle&gt; into List&lt;CarAxle&gt; - even though there's an inheritance chain there. You have to cast each object into a new List (though that becomes much easier with LINQ). I'd go for generics myself.
There was a good blog post on the subject @ [coding horror][1] Personally I try to keep its use to a minimum, I have found it hurts readability. [1]: http://www.codinghorror.com/blog/archives/001136.html
There was a good discussion on this @ [Coding Horror][1] Personally I try to keep its use to a minimum, I have found it hurts readability especially when assigning a variable from a method call. [1]: http://www.codinghorror.com/blog/archives/001136.html
Sockets in Pascal
|sockets|networking|pascal|
How do you use network sockets in Pascal?
Here's an example taken from http://www.bastisoft.de/pascal/pasinet.html program daytime; { Simple client program } uses sockets, inetaux, myerror; const RemotePort : Word = 13; var Sock : LongInt; sAddr : TInetSockAddr; sin, sout : Text; Line : String; begin if ParamCount = 0 then GenError('Supply IP address as parameter.'); with sAddr do begin Family := af_inet; Port := htons(RemotePort); Addr := StrToAddr(ParamStr(1)); if Addr = 0 then GenError('Not a valid IP address.'); end; Sock := Socket(af_inet, sock_stream, 0); if Sock = -1 then SockError('Socket: '); if not Connect(Sock, sAddr, sizeof(sAddr)) then SockError('Connect: '); Sock2Text(Sock, sin, sout); Reset(sin); Rewrite(sout); while not eof(sin) do begin Readln(sin, Line); Writeln(Line); end; Close(sin); Close(sout); Shutdown(Sock, 2); end.
Zeroconf and other discovery protocols are similarly referred to as the greatest thing since sliced bread; it's just that the flavor keeps changing.
@Chris > Something like: Dim myArray(10) as String > Would give you an array of 10 String references (each pointing to Nothing). VB is [0-indexed in array declarations][1], so you'd actually have 11 elements in that array. It's a common mistake when translating from C languages. As for the question, either of the following would work: Dim str(0) as String Dim str() as String = New String() { } [1]: http://msdn.microsoft.com/en-us/library/02e7z943(VS.80).aspx
>Are you executing the programs directly or going through the shell? If you always launch an external program by giving the full path name to the executable and leaving the shell out of the equation, then you aren't really susceptible to any kind of command line injection. **@Curt Hagenlocher** The backtick can kill you. If the Windows System is setup "wrong", or the unix system allows it, a dir &bt;del *&bt; will first execute the del * command then use the output in place of the del *, which in this case, won't matter because there is nothing to dir (or ls)
Can someone explain __all__ in Python?
|python|
Programatically determine how many Comments a blog post has
|rss|comments|
What is the most efficient way to determine how many comments a particular blog post has? We want to store the data for a new web app. We have a list of permalink URl's as well as the RSS feeds.
If the blog is controlled by you, a "Select count(commentid) FROM comments WHERE postID = 2" will possibly the best thing. If you only have the URL but still it's your blog/db, you need to create a subquery "WHERE postID = (SELECT whatever FROM posts WHERE permalink = url)" or whatever your way to join the comments to the posts from a URL. If it's a remote blog, you have the problem that each blog has different HTML. Essentially, you're going to need to build a parser that parses the HTML and looks for repeating elements like "div class=comment". But that will be mostly a manual labour for each different blogs. Some blogs may have better ways like a comment count somewhere in the HTML or some interface, but i'm not aware of any standardized way. EDIT: If you got a Comment-RSS feed, you *may* have luck using a mechanism that counts XML nodes, like XPath's [Count][1]. [1]: http://msdn.microsoft.com/en-us/library/ms256103.aspx
A jQuery object is a set of elements. In your case, a set of one element. This differs from certain other libraries, which wrap single elements and provide alternate syntax for selectors that return multiple matches. *[Aaron W][1] and [VolkerK][2] already explained how to access the first (index 0) element in the set.* [1]: http://stackoverflow.com/questions/47837/getting-the-base-element-from-a-jquery-object#47848 [2]: http://stackoverflow.com/questions/47837/getting-the-base-element-from-a-jquery-object#47844
@Tim Depending on the licensing you might be able to use the TUN/TAP driver that is part of OpenVPN, see [here](http://www.varsanofiev.com/inside/using_tuntap_under_windows.htm) for details.
In addition to the answer of Rob Walker: Nowadys you have things like the Native POSIX Thread Library - if you want. But for a long time the only way to "delegate" the work in the unix world was to use fork() (and it's still prefered in many,many circumstances). e.g. some kind of socket server <pre>socket_accept() fork() if (child) handleRequest() else goOnBeeingParent() </pre>Therefore the implementation of fork had to be fast and lots optimizations have been implemented over time. Microsoft endorsed CreateThread or even fibers instead of creating new processes and usage of interprocess communication. I think it's not "fair" to compare CreateProcess to fork since they are not interchangeable. It's probably more appropriate to compare fork/exec to CreateProcess.
Is it worth learning to use MSBuild?
|.net|msbuild|
I simply wondered whether people thought it was worth learning to use the MSBuild syntax in order to customise the build process for a .net project, or whether it is really not worth it given the ease with which one can build a project using visual studio. I am thinking in terms of nightly builds, etc., but then couldn't I use a scheduled event which uses the command-line build option built into VS? Are there superior tools out there?
Off-the-Shelf Hex Dump Code
|hexdump|c++|logging|
I work a lot with network and serial communications software, so it is often necessary to display or log hex dumps of data packets. Every time I do this, I write yet another hex-dump routine from scratch. I'm about to do so again, but figured I'd ask here: Is there any good free hex dump code for C++ out there somewhere? Features I'd like: - N bytes per line (where N is configurable) - ASCII dump alongside the hex - configurable indentation, per-line prefixes, per-line suffixes, etc.
I work a lot with network and serial communications software, so it is often necessary to display or log hex dumps of data packets. Every time I do this, I write yet another hex-dump routine from scratch. I'm about to do so again, but figured I'd ask here: Is there any good free hex dump code for C++ out there somewhere? Features I'd like: - N bytes per line (where N is somehow configurable) - optional ASCII/UTF8 dump alongside the hex - configurable indentation, per-line prefixes, per-line suffixes, etc.
|hexdump|c++|logging|hex|
I work a lot with network and serial communications software, so it is often necessary to display or log hex dumps of data packets. Every time I do this, I write yet another hex-dump routine from scratch. I'm about to do so again, but figured I'd ask here: Is there any good free hex dump code for C++ out there somewhere? Features I'd like: - N bytes per line (where N is somehow configurable) - optional ASCII/UTF8 dump alongside the hex - configurable indentation, per-line prefixes, per-line suffixes, etc. - minimal dependencies (ideally, I'd like the code to all be in a header file) **Edit:** Clarification: I am looking for code that I can easily drop in to my own programs. I'm not looking for a hex dump utility.
|c++|logging|hex|hexdump|
I work a lot with network and serial communications software, so it is often necessary for me to have code to display or log hex dumps of data packets. Every time I do this, I write yet another hex-dump routine from scratch. I'm about to do so again, but figured I'd ask here: Is there any good free hex dump code for C++ out there somewhere? Features I'd like: - N bytes per line (where N is somehow configurable) - optional ASCII/UTF8 dump alongside the hex - configurable indentation, per-line prefixes, per-line suffixes, etc. - minimal dependencies (ideally, I'd like the code to all be in a header file) **Edit:** Clarification: I am looking for code that I can easily drop in to my own programs. I'm not looking for a hex dump utility.
application/octet-stream You can stream the contents of a .eml file to a browser with this content type and .mht as the extension, and the email will be rendered similar to the way it is rendered in an email client.
I like DocBook, but it doesn't really fit. It strives to be presentation-independent, the intention being that you would use XSLT to render it to a presentation format. In a word processor, the user is editing presentation along with the content. For example, the user doesn't want to mark a "keyword", necessarily, they want to make some text bold. A DocBook editor would be a very nice thing (I'm not sure a good one exists), but it's not really what I'm doing.
What is the Difference Between Mercurial and Git?
|git|comparison|mercurial|version-control|
I've been using git for some time now on Windows (with msysGit) and I like the idea of distributed source control. Just recently I've been looking at Mercurial (hg) and it looks interesting. However, I can't wrap my head around the differences between hg and git. Has anyone made a side-by-side comparison between git and hg? I'm interested to know what differs hg and git without having to jump into a fanboy discussion.
I know I'm probably stating the obvious, but don't forget that the quality of the development team and their familiarity with the technology will have a major impact on your ability to deliver. If you have a strong team, then it's probably not an issue if they're familiar. But if you have people who are more 9 to 5'rs who aren't familiar with the technology, they will need more support and you'd need to make a call if the productivity gains are worth whatever the cost of that support is.
As others have said SQL 2008 comes with a Filestream type that allows you to store a filename or identifier as a pointer in the db and automatically stores the image on your filesystem which is a great scenario. If you're on an older database, then I'd say that if you're storing it as blob data, then you're really not going to get anything out of the database in the way of searching features, so it's probably best to store an address on a filesystem, and store the image that way. That way you also save space on your filesystem, as you are only going to save the exact amount of space, or even compacted space on the filesystem. Also, you could decide to save with some structure or elements that allow you to browse the raw images in your filesystem without any db hits, or transfer the files in bulk to another system, hard drive, S3 or another scenario - updating the location in your program, but keep the structure, again without much of a hit trying to bring the images out of your db when trying to increase storage. Probably, it would also allow you to throw some caching element, based on commonly hit image urls into your web engine/program, so you're saving yourself there as well.
Refactoring is inevitable on larger codebases and the lack of static typing makes this much harder in python than in statically typed languages.
Process ID in Java
|java|pid|
How do I get the id of my Java process? I know there are several platform-dependent hacks, but I'm after a generic solution.
Have you tried manually modifying the XSL in order to generate HTML which embedds your audio file? I don't think there is a way to do this using the InfoPath Designer, but if it ends up in the XSL; it may just get passed through to the web enabled form.
I'm currently in the process of migrating from SVN to a DVCS (while blogging about my findings, my first real blogging effort...), and I've done a bit of research (=googling). As far as I can see you can do most of the things with both packages. It seems like git has a few more or better implemented advanced features, I do feel that the integration with windows is a bit better for mercurial, with TortoiseHg. I know there's Git Cheetah as well (I tried both), but the mercurial solution just feels more robust. Seeing how they're both open-source (right?) I don't think either will be lacking important features. If something is important, people will ask for it, people will code it. I think that for common practices, Git and Mercurial are more than sufficient. They both have big projects that use them (Git -> linux kernel, Mercurial -> Mozilla foundation projects, both among others of course), so I don't think either are really lacking something. That being said, I am interested in what other people say about this, as it would make a great source for my blogging efforts ;-)
The other suggestions are good if you have "SQL only". However I suggest, that - **if possible** - you calculate the date in your program and insert it as string in the SQL query. At least for for big tables (i.e. several million rows, maybe combined with joins) that will give you a considerable speed improvement as the optimizer can work with that much better.
try beanshell. its a scripting wrapper over java. http://www.beanshell.org/
FYI, I continued to research and answered my own question. From: http://forums.microsoft.com/TechNet/ShowPost.aspx?PostID=2235413&SiteID=17 I just altered my report's text box to: "=Fields!Addr1.Value + VbCrLf + Fields!Addr2.Value + VbCrLf + Fields!Addr3.Value"
Some must have C++ books that will help you avoid common C++ pitfalls: [Effective C++][1] [More Effective C++][2] [Effective STL][3] The Effective STL book explains the vector of bools issue :) [1]: http://www.amazon.com/Effective-Specific-Addison-Wesley-Professional-Computing/dp/0321334876/ref=pd_bbs_sr_1?ie=UTF8&s=books&qid=1219849906&sr=8-1 [2]: http://www.amazon.com/More-Effective-Addison-Wesley-Professional-Computing/dp/020163371X/ref=pd_bbs_sr_3?ie=UTF8&s=books&qid=1219849906&sr=8-3 [3]: http://www.amazon.com/Effective-STL-Addison-Wesley-Professional-Computing/dp/0201749629/ref=pd_bbs_sr_2?ie=UTF8&s=books&qid=1219849906&sr=8-2
> And is there a way to populate the table with a list of key->value pairs without individually calling an add method on the object for each pair? One problem with your question is that you don't mention what what form your data is in to begin with. If your list of pairs happened to be a list of Map.Entry objects it would be pretty easy. Just to throw this out, there is a (much maligned) class named java.util.Properties that is an extension of Hashtable. It expects only String keys and values and lets you load and store the data using files or streams. The format of the file it reads and writes is as follows: key1=value1 key2=value2 I don't know if this is what you're looking for, but there are situations where this can be useful.
*Info*: Ajax Navigation is a [regular feature][1] of the upcoming IE8. [1]: http://blogs.msdn.com/ie/archive/2008/07/14/ie8-ajax-navigation.aspx
@[wvdschel][1]: Don't create separate partitions for each user. Unused space on each partition is wasted. Instead create one partition for all users. Use `quota` if necessary to limit each user's space. It's much more flexible than partitioning or LVM. OTOH, one huge partition is usually a bit slower, depending on the file system. [1]: #17036
I'm not aware of anyone who keeps track of this publicly on a regular basis (unlike Adobe who pushes it every chance they get). The closest that I could come was [this article][1] from last November. Based upon his site, this data could be skewed a bit, but I think we fairly similar numbers as well. [1]: http://kaioa.com/node/40
Did you know 1TB can easily take up to half an hour to `fsck`? Workstations usually crash and reboot more often than servers, so that can get quite annoying. Do you really need all that space?
I have been using Python more and more, and I keep seeing the variable `__all__` set in different `__init__.py` files. Can someone explain what this does?
The important thing to remember here is that Ruby methods can be (un)defined at any point, so to intelligently resolve the ambiguity, every assignment would need to run code to check whether there is a method with the assigned-to name at the time of assignment.
Your users will not be able to connect to the NTLM site directly without getting an NTLM challenge. I would write what would effectively be a proxy to the NTLM site; i.e your server-side code will have credentials to connect to the NTLM site, and it passes through the requests from your users. As you mention it's SharePoint (*spit*) bear in mind that SharePoint has a bunch of Web Services you could use for this (rather than doing screen-scraping).
> General programming translates terribly to GPUs. GPUs are dedicated to performing fairly simple tasks on streams of data at a massive rate, with massive parallelism. They do not deal well with the rich data and control structures of general programming, and there's no point trying to shoehorn that into them. This isn't too far away from my impression of the situation but at this point we are not concerning ourselves too much with that. We are starting out by getting a broad picture of which options we have to focus on. After that is done we will analyse them a bit deeper and find out which, if any, are plausible options. If we end up determining that it is impossible to do anything within the field, and we are only increasing everybody's electricity bill then that is a valid result as well.
I am pretty much hook to: - The Java Posse - Software Engineering Radio
When you [Process.Start][1] a new process, supply the parameters in its Parameters argument instead of building the whole command line yourself. Haven't got time for a proper test, but I think that should help guard it to some level. Will test this out tomorrow. **EDIT:** Ah, someone beat me to it again. But here's another point: Try using the Console.InputStream (can't remember exact name) to supply data instead of passing parameters, is that a possible solution? like fix the command so it reads from the CON device and you then supply the data via input stream instead. [1]: http://msdn.microsoft.com/en-us/library/system.diagnostics.process.start(VS.71).aspx
I'm sure there is an easier way, but you could loop through the sysobjects table in the database and grant permissions to any user table objects that exist. You could then run that multiple times whenever new tables are added.