instruction
stringlengths
0
30k
⌀
I'm looking for a way of getting a concurrent collection in C# or at least a collection which supports a concurrent enumerator. Right now I'm getting an InvalidOperationException when the collection over which I'm iterating changes. I could just deep copy the collection and work with a private copy but I'm wondering ...
|c#|concurrency|
I'm looking for a way of getting a concurrent collection in C# or at least a collection which supports a concurrent enumerator. Right now I'm getting an InvalidOperationException when the collection over which I'm iterating changes. I could just deep copy the collection and work with a private copy but I'm wondering ...
Boolean algebra is fundamental to understanding control structures and refactoring. For example, I've seen many bugs caused by programmers who didn't know (or couldn't use) deMorgan's law. As another example, how many programmers immediately recognize that if (condition-1) { if (condition-2) { ...
How about just checking to see if Javascript is enabled? Anyone using this site is surely going to have it enabled. And from what folks say, the Spambots won't have javascript enabled.
Like you, I don't usually create foreign keys by hand, but if for some reason I need the script to do so I usually create it using ms sql server management studio and before saving then changes, I select Table Designer | Generate Change Script
You should really tell us how you are trying to do this currently, but on my system (using linux) the following snippet will run a command without opening a new terminal window. It should work the same way on windows. module Main where import System import System.Process import Control.Monad ...
Using a goto makes it far too easy to write "spaghetti code" which is not particularly maintainable. The most important rule to follow is to write readable code, but of course it depends on what the goals of the project are. As a "best practice" avoiding a goto is a good idea. It's something extreme programming type...
The simplest way is to set a cookie via javascript and check for it on postback.However, if you're looking to minimize spam you should actually have the browser perform a simple task which requires javascript execution. See Phil Haack's "Invisibile Captcha Validator" control, which has since been included in his Subkis...
Thanks! Here is the completed refactor with your suggested changes. <script language="javascript"> $(document).ready(function() { $('#Email_Address_1').keyup(function(){Update_Email_Validate_Status(this)}); $('#Email_Address_2').keyup(function() { Update_Email_Valid...
var S : TMemoryStream; begin S := TMemoryStream.Create; try TBlobField(AdoQuery1.FieldByName('ImageField')).SaveToStream(S); S.Position := 0; Image1.Picture.Graphic.LoadFromStream(S); finally S.Free; end; end; if you are using JPEG ...
Well, if you cannot ever sneak in with a connection, I dunno', but if you can occasionally sneak in, in Ruby it would be close to: require 'mysql' mysql = Mysql.new(ip, user, pass) processlist = mysql.query("show full processlist") killed = 0 processlist.each { | process | mysql.quer...
You could do delayed delinking where you set nodes to be delinked out of the list with a flag and then delete them on the next proper traversal. Nodes set to be delinked would need to be properly handled by the code that crawls the list. I suppose you could also just traverse the list again from the beginning until...
Why does a C/C++ program often have optimization turned off in debug mode?
|c++|c|compiler-construction|
In most C or C++ environments, there is a "debug" mode and a "release" mode compilation. Looking at the difference between the two, you find that the debug mode adds the debug symbols (often the -g option on lots of compilers) but it also disables most optimizations. In "release" mode, you usually have all sorts ...
I often stumble upon such problems in Visual Studio. In many cases MSVS forms designer fails to render form correctly. Back in the days I worked with WinForms I had to do all kind of weird tricks to enable some complex scenarios. However I think that using visual inheritance is very beneficial and should not be thrown ...
I think that most naming conventions will vary but the developer, for example I name variables like: mulitwordVarName, however some of the dev I have worked with used something like mulitword_var_name or multiwordvarname or aj5g54ag or... I think it really depends on your preference.
You can use string formatters to accomplish the same thing. double MyNumber = inv.RRP * oCountry.ExchangeRate; JSArrayString += "^" + MyNumber.ToString("#0.00");
The tool to do that would be svnadmin dump But for this to work, you need filesystem-access to the repository. And once you have that (and provided the repository is in FSFS format), you can just copy the repository to its new location (if it's in BDB format, dump/restore is strongly recommended). If you ...
The tool to do that would be svnadmin dump But for this to work, you need filesystem-access to the repository. And once you have that (and provided the repository is in FSFS format), you can just copy the repository to its new location (if it's in BDB format, dump/load is strongly recommended). If you do ...
I think that you cannot specify SP1, only different versions of the framework. It does make sense, otherwise you could have a lot of problems with an application specifically compiled for a given SP. You can also have problems with the current situation, but I think it's less headache.
Depending on your needs, [awk](http://en.wikipedia.org/wiki/AWK) is more flexible than cut. A first teaser: # echo "system-source-yyyymmdd.dat" \ |awk -F- '{printf "System: %s\nSource: %s\nYear: %s\nMonth: %s\nDay: %s\n", $1,$2,substr($3,1,4),substr($3,5,2),substr($3,7,2)}' Syste...
If you want to move the repository and keep history, you'll probably need filesystem access on both hosts. The simplest solution, if your backend is FSFS (the default on recent versions), is to make a filesystem copy of the entire repository folder. If you have a Berkley DB backend, if you're not sure of what your ...
For the past few weeks, I've been trying to learn about just how email works. I understand the process of a client receiving mail from a server using POP pretty well. I also understand how a client computer can use SMTP to ask an SMTP server to send a message. However, I'm still missing something... The way I und...
|email|smtp|pop|
|email|smtp|pop3|
|email|smtp|pop3|
Java + MS SQL Server - a viable solution?
|java|sql|server|
I'm going to start a new project - rewriting an existing system (PHP + SQL Server) from scratch because of some very serious limitations by design. We have some quite good knowledge of SQL Server (currently we're using SQL Server 2000 in existing system) and we would like to employ its newer version (2008 I guess) in ...
|java|sql|server|
Is there some way to PUSH data from web server to browser?
|internet|browser|server|webserver|
Of course I am aware of Ajax, but the problem with Ajax is that the browser should poll the server frequently to find whether there is new data. This increases server load. Is there any better method (even using Ajax) other than polling the server frequently?
Visual Studio equivalent to Delphi bookmarks
|visual-studio|delphi|
I use Delphi for many years, and although I have now moved on to Visual Studio I still fondly remember numbered bookmarks (CTRL+K+1 to set bookmark 1, CRTL+Q+1 to goto bookmark 1). Is there a Visual Studio equivalent? I'm find the dumb bookmarks in VS a chore after Delphi. I want to bookmark then return to a specifi...
Ctrl K + Ctrl K - Add/Remove Bookmark on Line Ctrl K + Ctrl N - Go to Next Bookmark Ctrl K + Ctrl P - Go to Previous Bookmark There are other options as well. Look under Edit->Bookmarks menu,
MPP does have its own object model that can be used to access data in it. The info should be available here: <http://msdn.microsoft.com/en-us/office/aa905469.aspx>
Which database table Schema is more efficient?
|database-design|
Which Database table Schema is more efficient and why? "Users (UserID, UserName, CompamyId)" "Companies (CompamyId, CompanyName)" OR "Users (UserID, UserName)" "Companies (CompamyId, CompanyName)" "UserCompanies (UserID, CompamyId)" Given the fact that user and company have one-to-one...
Your webservice object has a "URL" property on it which can be set via the web.config file. There's a config file that gets created when you add the web reference to your application that you should copy the contents of to your web.config or app.config file. You can then deploy the config file and not have to manage an...
Issue in Oracle Sql Query
|oracle-database|sql|.net|
I am facing problem with an Oracle Query in a .net 2.0 based windows application. I am using "*System.Data.OracleClient*" to connect to oracle database. Name of database is "*myDB*". Below the the connection string I am using: *Data Source=(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP) (HOST = 172.16.0.2...
I am facing problem with an Oracle Query in a .net 2.0 based windows application. I am using "*System.Data.OracleClient*" to connect to oracle database. Name of database is "*myDB*". Below the the connection string I am using: *Data Source=(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP) (HOST = 172.16.0.2...
Without any optimization on, the flow through your code is linear. If you are on line 5 and single step, you step to line 6. With optimization on, you can get instruction re-ordering, loop unrolling and all sorts of optimizations. For example: <pre><code> void foo() { 1: int i; 2: for(i = 0; i &lt 2; ) 3: ...
There's definitely three objects in play here: 1) Terrain 2) Terrain Effects 3) Units I would not suggest creating a map with the _pair_ of terrain/unit as a key to look up the action. That is going to make it difficult for you to make sure you've got every combination covered as the lists of units and ter...
"size" is the traditional tool. "readelf" has a lot of options. $ size /bin/sh text data bss dec hex filename 712739 37524 21832 772095 bc7ff /bin/sh
"size" is the traditional tool. "readelf" has a lot of options. $ size /bin/sh text data bss dec hex filename 712739 37524 21832 772095 bc7ff /bin/sh
- "size" is the traditional tool and works on all unix flavors. - "otool" has a bit finer grain control and has a lot of options. . $ size python __TEXT __DATA __OBJC others dec hex 860160 159744 0 2453504 3473408 350000
- "size" is the traditional tool and works on all unix flavors. - "otool" has a bit finer grain control and has a lot of options. . $ size python __TEXT __DATA __OBJC others dec hex 860160 159744 0 2453504 3473408 350000
**This got me into unit testing and it made me very happy** We just started to do unit testing. For a long time I knew it would be good to start doing it but I had no idea how to start and more importantly what to test. Then we had to rewrite an important piece of code in our accounting program. This part was v...
Leave it. It's one great example of how your IDE is dictating your coding style.
**Unit testing is a lot like going to the gym.** You know it is good for you, all the arguments make sense, so you start working out. There's an initial rush, which is great, but after a few days you start to wonder if it is worth the trouble. You're taking an hour out of your day to change your clothes and run on a...
How is the table being populated? While it is possible to scrub this in sql a better approach would be to change the column type to int and scrub the data before it's loaded into the database (SSIS). Is this an option?
Discrete Math Linear Algebra Combinatorics Probability and Statistics Graph Theory
What are the core mathematical concepts a good developer should know?
|language-agnostic|algorithm|math|
Since Graduating from a very small school in 2006 with a badly shaped & outdated program (I'm a foreigner & didnt know any better school at the time) i've come to realize that i missed a lot of basic concepts from a mathematical & software perspective that are mostly the foundations of other higher concepts. i.e. i ...
|language-agnostic|algorithm|math|
Since Graduating from a very small school in 2006 with a badly shaped & outdated program (I'm a foreigner & didnt know any better school at the time) i've come to realize that i missed a lot of basic concepts from a mathematical & software perspective that are mostly the foundations of other higher concepts. i.e. i ...
I'm guessing you are using a native-code&ndash;based database driver (JDBC driver type 1 or 2). And I'm guessing that driver is buggy. If you could provide more information about the driver and your datasource configuration or connection string, it might help determine some answers.
I have an HttpModule that implements a stream rewriter. It derives from the Stream class. In my HttpModule I have the following code: void app_PreRequestHandlerExecute(object sender, EventArgs e) { HttpResponse response = HttpContext.Current.Response; response.Filter = new MyRewriterStre...
What is the point of clog?
|ajax|server|internet|comet|
|ajax|server|internet|comet|
What means the error SECJ0222E in WebSphere Application Server 5.1
|websphere|ibm|
I'm getting for that error this help in <a href="http://www-1.ibm.com/support/docview.wss?rs=404&uid=swg1PK06349">IBM's support site</a>: <blockquote> <b>Problem</b>A JAAS LoginContext could not be created due to the unexpected exception. <br/> <b>User response</b>The problem could be due to a configuration error....
|websphere|ibm|
What is called a Node in a WebSpere Network Deployment
|websphere|deployment|cluster-analysis|
In a installation of WebSphere Application Server with Network Deployment, a node is: <ol> <li>a physical machine</li> <li>an instance of operative system</li> <li>a logical set of WAS instances that is independent of physical machine or OS instance</li> </ol>
|deployment|cluster-analysis|websphere|
|deployment|websphere|cluster-analysis|
Closet server versus Colo?
|hardware|storage|
As a programmer I need a place to store my stuff. I've been running a server in my parents closet for a long time, but I recently came across a decent 2U server. I have no experience dealing with hosting companies, beyond the very cheap stuff, and I'm wondering what I should look for in a colo or if I should just keep ...
|hardware|storage|
Ajax polling.
|php|ajax|chat|
In the project i am currently working on, we have the need to develop a web chat application, not a very complex chat, just a way to connect two people to talk about a very specific topic, we don't need any kind of authentication for one of the two users, we don't have to support emoticons, avatars, or stuff like that....
|php|ajax|chat|
Cleanest & Fastest server setup for Django
|django|hosting|python|
These aren't combinations per-say but are good colours if you're just looking to mock something up (or if you're like me and have the colour sense of a bat). * **[Google Docs & Spreadsheets: Web 2.0 Colours][1]** - found this recently and it's been *very* helpful. * **[Modern Life is Rubbish: Web 2.0 Colour Palette...
G'day, I totally agree with the suggestions to read and digest what the compiler is telling you after setting -Wall. A good static analysis tool for security is [FlawFinder][1] written by David Wheeler. It does a good job looking for various security exploits, However, it doesn't replace having a knowledgable ...
@[Marius][1] I don't know if it's faster, but you can do it without regexes: function subst($str, $dict) { foreach ($dict AS $key, $value) { $str = str_replace($key, $value, $str); } return $str; } [1]: http://stackoverflow.com/questions/28165/does-p...
Just to mention an alternative to VMWare Fusion, I'm using Parallels als a VM. Performance has not been an issue so far when I've given the VM 1 GiB of main memory. Before deciding on one VM, I'd suggest testing them all extensively. I am quite happy with Parallels but I'm not sure I wouldn't use VMWare Fusion the next...
I am developing .net applications using XP Pro in VMWare Fusion and I am not finding any issues. I am not even seeing any performance issues as the hardware in the MacBook Pro is much better than the hardware I had in my previous laptop. I found that there were a few things that I had to fiddle with to make the expe...
I am developing .net applications using XP Pro in VMWare Fusion and I am not finding any issues. I am not even seeing any performance issues as the hardware in the MacBook Pro is much better than the hardware I had in my previous laptop. I found that there were a few things that I had to fiddle with to make the expe...
|.net|sql|oracle-database|
I am facing problem with an Oracle Query in a .net 2.0 based windows application. I am using "*System.Data.OracleClient*" to connect to oracle database. Name of database is "*myDB*". Below the the connection string I am using: *Data Source=(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP) (HOST = 172.16.0.2...
I am facing problem with an Oracle Query in a .net 2.0 based windows application. I am using "*System.Data.OracleClient*" to connect to oracle database. Name of database is "*myDB*". Below the the connection string I am using: *Data Source=(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP) (HOST = 172.16.0.2...
I am facing problem with an Oracle Query in a .net 2.0 based windows application. I am using "*System.Data.OracleClient*" to connect to oracle database. Name of database is "*myDB*". Below the the connection string I am using: *Data Source=(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP) (HOST = 172.16.0.2...
For sure, the earlier one is more efficient given that constraint. For getting the same information, you will have less number of joins in your queries.
As always it depends. I would personally go with answer number one since it would have less joins and would be easier to maintain. Less joins should mean that it requires less table and index scans. SELECT userid, username, companyid, companyname FROM companies c, users u WHERE userid = companyid Is...