Id
int64
4
8.51M
PostTypeId
int64
1
7
AcceptedAnswerId
int64
7
75.5M
ParentId
int64
4
41.8M
Score
int64
-208
27.7k
ViewCount
int64
11
12.4M
Body
stringlengths
0
45k
Title
stringlengths
2
150
ContentLicense
stringclasses
3 values
FavoriteCount
int64
0
225
CreationDate
stringdate
2008-07-31 21:42:52
2011-12-14 18:48:47
LastActivityDate
stringdate
2008-08-01 12:19:17
2023-03-05 04:40:26
LastEditDate
stringdate
2008-08-01 13:54:25
2023-03-05 03:12:45
LastEditorUserId
int64
-1
21.3M
OwnerUserId
int64
-1
21.1M
Tags
listlengths
1
6
24,241
1
24,254
null
13
41,856
Can you use windows hooks or other methods to do code injection with c#? I've seen lots of things about code injection but all of them are done in C/C++. I don't know either of those languages and have a really hard time translating. Does anyone have any ideas on how to do this?
Code Injection With C#
CC BY-SA 2.5
0
2008-08-23T13:57:06.263
2018-04-01T04:20:56.813
2011-03-31T04:54:08.397
503,969
2,128
[ "c#", "code-injection" ]
24,243
1
24,244
null
3
830
I have a SqlServer database that I've manually filled with some test data. Now I'd like to extract this test data as insert statements and check it in to source control. The idea is that other team members should be able to create the same database, run the created insert scripts and have the same data to test and deve...
Select existing data from database to create test data
CC BY-SA 2.5
0
2008-08-23T14:01:32.413
2008-11-19T22:14:07.240
2017-05-23T12:08:38.563
-1
298
[ "sql-server", "database" ]
24,244
2
null
24,243
1
null
EMS DB Extract for SQL Server ([http://www.sqlmanager.net/en/products/mssql/extract](http://www.sqlmanager.net/en/products/mssql/extract)) seems to do what you want, and it seems to be free. Hope this helps, Robin
null
CC BY-SA 2.5
null
2008-08-23T14:04:05.917
2008-08-23T14:04:05.917
null
null
1,912
null
24,211
2
null
24,168
17
null
Set based queries are (usually) faster because: 1. They have more information for the query optimizer to optimize 2. They can batch reads from disk 3. There's less logging involved for rollbacks, transaction logs, etc. 4. Less locks are taken, which decreases overhead 5. Set based logic is the focus of RDBMSs, so the...
null
CC BY-SA 2.5
null
2008-08-23T13:06:58.753
2008-08-23T13:06:58.753
null
null
2,199
null
24,223
2
null
24,196
1
null
Maybe the way to go is something like [Clutter](http://clutter-project.org/) or [Allegro](http://www.allegro.cc/). If you check in this [article](http://arstechnica.com/news.ars/post/20080604-hands-on-with-the-ubuntu-netbook-remix.html) at ArsTechnica what they are using Clutter for, you might get an idea how to use it...
null
CC BY-SA 2.5
null
2008-08-23T13:24:48.540
2008-08-23T13:24:48.540
null
null
2,384
null
24,246
2
null
24,243
1
null
Red-Gate [SQL Data Compare](http://www.red-gate.com/products/SQL_Data_Compare/index.htm) will do this. Just create a blank data base with the same schema, and run a compare against the original and the blank database. It will generate scripts to insert all of your test data.
null
CC BY-SA 2.5
null
2008-08-23T14:06:30.093
2008-08-23T14:06:30.093
null
null
1,436
null
24,242
2
null
9
30
null
I have created a SQL Server User Defined Function to calculate someone's age, given their birthdate. This is useful when you need it as part of a query: ``` using System; using System.Data; using System.Data.Sql; using System.Data.SqlClient; using System.Data.SqlTypes; using Microsoft.SqlServer.Server; public partial...
null
CC BY-SA 3.0
null
2008-08-23T13:58:02.860
2016-02-07T00:07:00.480
2016-02-07T00:07:00.480
2,921,691
2,601
null
24,248
2
null
24,193
2
null
OK, I see. Well, as far as I know there isn't any code generator for Python. There is a good introduction on how to roll your own [here](http://www.drewnoakes.com/snippets/WritingACustomCodeGeneratorToolForVisualStudio/). Actually, that's quite an under-used part of the environment, I suppose it's so because it needs ...
null
CC BY-SA 2.5
null
2008-08-23T14:07:27.080
2008-08-23T14:07:27.080
null
null
2,384
null
24,260
2
null
2,873
2
null
Lint-like tools generally suffer from a "false alarm" problem: they report a lot more issues than really exist. If the proportion of genuinely-useful warnings is too low, the user learns to just ignore the tool. More modern tools expend some effort to focus on the most likely/interesting warnings.
null
CC BY-SA 2.5
null
2008-08-23T14:29:04.923
2008-09-08T14:21:05.777
2008-09-08T14:21:05.777
1,412
1,412
null
24,259
2
null
3,260
6
null
This problem has been studied in some detail. There are a set of very up-to-date implementations in the `TSpectrum*` classes of [ROOT](http://root.cern.ch/) (a nuclear/particle physics analysis tool). The code works in one- to three-dimensional data. The ROOT source code is available, so you can grab this implementa...
null
CC BY-SA 2.5
null
2008-08-23T14:28:23.130
2008-10-16T16:52:28.750
2008-10-16T16:52:28.750
2,509
2,509
null
24,264
2
null
24,109
10
null
If you like Eclipse for Java, I suggest Eclipse CDT. Despite C/C++ support isn't so powerful as is for Java, it still offers most of the features. It has a nice feature named Managed Project that makes working with C/C++ projects easier if you don't have experience with Makefiles. But you can still use Makefiles. I do...
null
CC BY-SA 2.5
null
2008-08-23T14:32:22.387
2008-08-23T14:32:22.387
null
null
1,009
null
24,254
2
null
24,241
6
null
Kevin, it is possible. You can create library with window hook proc using managed C++. All you need to do is to inject this hook into some application using standard WinAPI (SetWindowsHookEx etc.). Inside this hook you can call System::AppDomain::CurrentDomain->Load method to load your assembly into target application'...
null
CC BY-SA 3.0
null
2008-08-23T14:23:52.330
2018-04-01T04:20:56.813
2018-04-01T04:20:56.813
4,875,631
1,196
null
24,271
2
null
24,270
28
null
Verging on religious but I would say that you're painting an overly grim picture of the state of modern OOP. I would argue that it actually reduced costs, made large software projects manageable, and so forth. That doesn't mean it's solved the fundamental problem of software messiness, and it doesn't mean the average ...
null
CC BY-SA 2.5
null
2008-08-23T14:45:23.883
2008-08-23T14:45:23.883
null
null
null
null
24,258
2
null
24,113
1
null
I don't know the answer to your question, but I would highly recommend Add-In Express for doing the addin. See [http://www.add-in-express.com/add-in-net/](http://www.add-in-express.com/add-in-net/). I've used this in many projects, including some commercial software and it is completely awesome. It does all the Outl...
null
CC BY-SA 2.5
null
2008-08-23T14:28:20.307
2008-08-23T14:28:20.307
null
null
1,627
null
24,270
1
25,061
null
126
30,195
As far as I can tell, in spite of the countless millions or billions spent on OOP education, languages, and tools, OOP has not improved developer productivity or software reliability, nor has it reduced development costs. Few people use OOP in any rigorous sense (few people adhere to or understand principles such as LS...
What's the point of OOP?
CC BY-SA 2.5
0
2008-08-23T14:40:28.687
2016-07-08T17:11:10.447
2008-08-23T16:00:19.070
1,190
2,131
[ "language-agnostic", "oop" ]
24,274
2
null
24,262
4
null
It seems you have misplaced the parameters in File.Copy(), it should be File.Copy(string source, string destination). Also is "C:\Test2" a directory? You can't copy file to a directory. Use something like that instead: ;
null
CC BY-SA 2.5
null
2008-08-23T14:47:54.207
2008-08-23T14:47:54.207
null
null
1,534
null
24,276
2
null
24,262
0
null
I'm kinda guessing here, but could it be because: - - - Sorry I cant be of more help, I have rarely experienced problems with File.Copy.
null
CC BY-SA 2.5
null
2008-08-23T14:50:10.037
2008-08-23T14:50:10.037
null
null
832
null
24,275
2
null
24,270
119
null
> The real world isn't "OO", and the idea implicit in OO--that we can model things with some class taxonomy--seems to me very fundamentally flawed While this is true and has been observed by other people (take Stepanov, inventor of the STL), the rest is nonsense. OOP may be flawed and it certainly is no silver bullet ...
null
CC BY-SA 2.5
null
2008-08-23T14:48:10.523
2008-08-23T19:34:31.613
2017-05-23T11:46:39.570
-1
1,968
null
24,283
2
null
17,928
1
null
@orion thats so cool. Never thought of it that way. Well @jschroedl thats was fun indeed. Testing an activex in console app is fun. But I think its worth not trying down that path. You can call the methods or set and get the properties either through the way @jschroedl had explained or you can call the IDIspatch obj...
null
CC BY-SA 2.5
null
2008-08-23T15:02:46.743
2008-08-23T15:02:46.743
null
null
1,781
null
24,227
2
null
24,221
17
null
> Also, are they unique to Java, is there a C++ equivalent? No, but VB and C# have [attributes](http://www.codeproject.com/KB/cs/dotnetattributes.aspx) which are the same thing. Their use is quite diverse. One typical Java example, `@Override` has no effect on the code but it can be used by the compiler to generate a...
null
CC BY-SA 3.0
null
2008-08-23T13:31:05.590
2013-11-26T05:05:58.650
2013-11-26T05:05:58.650
1,102,512
1,968
null
24,226
2
null
24,168
3
null
I think the real answer is, like all approaches in programming, that it depends on which one is better. Generally, a set based language is going to be more efficient, because that is what it was designed to do. There are two places where a cursor is at an advantage: 1. You are updating a large data set in a database...
null
CC BY-SA 3.0
null
2008-08-23T13:29:56.983
2014-05-01T07:12:27.767
2014-05-01T07:12:27.767
321,731
1,942
null
24,279
1
24,294
null
74
32,396
In my second year of University we were "taught" Haskell, I know almost nothing about it and even less about functional programming. What is functional programming, why and/xor where would I want to use it instead of non-functional programming and am I correct in thinking that C is a non-functional programming languag...
Functional programming and non-functional programming
CC BY-SA 3.0
0
2008-08-23T14:58:11.623
2020-01-15T14:53:25.967
2017-02-02T22:55:54.270
792,066
1,384,652
[ "functional-programming", "paradigms", "glossary" ]
24,202
2
null
23,962
5
null
If you're using C#, and can use [PostSharp](http://www.postsharp.org/), here's a simple memoization aspect for your code: ``` [Serializable] public class MemoizeAttribute : PostSharp.Laos.OnMethodBoundaryAspect, IEqualityComparer<Object[]> { private Dictionary<Object[], Object> _Cache; public MemoizeAttribute...
null
CC BY-SA 2.5
null
2008-08-23T12:54:54.603
2008-08-23T12:54:54.603
null
null
267
null
24,262
1
24,274
null
7
4,508
While creating a file synchronization program in C# I tried to make a method `copy` in `LocalFileItem` class that uses `System.IO.File.Copy(destination.Path, Path, true)` method where `Path` is a `string`. After executing this code with destination. `Path = "C:\\Test2"` and `this.Path = "C:\\Test\\F1.txt"` I get an exc...
About File permissions in C#
CC BY-SA 3.0
0
2008-08-23T14:31:21.780
2017-07-19T15:28:50.430
2017-07-19T15:28:50.430
3,179,310
2,605
[ "c#", "file", "copy" ]
24,290
2
null
24,270
6
null
@Konrad > OOP may be flawed and it certainly is no silver bullet but it makes large-scale applications much simpler because it's a great way to reduce dependencies That is the dogma. I am not seeing what makes OOP significantly better in this regard than procedural programming of old. Whenever I make a procedure call...
null
CC BY-SA 2.5
null
2008-08-23T15:11:06.413
2008-08-23T15:11:06.413
null
null
2,131
null
24,285
2
null
7,737
15
null
You should also check out the [FTGL library](http://sourceforge.net/projects/ftgl/). > FTGL is a free cross-platform Open Source C++ library that uses Freetype2 to simplify rendering fonts in OpenGL applications. FTGL supports bitmaps, pixmaps, texture maps, outlines, polygon mesh, and extruded polygon r...
null
CC BY-SA 2.5
null
2008-08-23T15:06:20.917
2008-08-23T15:06:20.917
null
null
803
null
24,289
2
null
24,279
3
null
Yes you are correct in thinking that C is a non-functional language. C is a procedural language.
null
CC BY-SA 2.5
null
2008-08-23T15:10:44.727
2008-08-23T15:10:44.727
null
null
1,912
null
24,286
2
null
24,270
5
null
@CodingTheWheel > But to the extent that OOP has been a waste of time, I'd say it's because of lack of programmer training, compounded by the steep learning curve of learning a language specific OOP mapping. Some people "get" OOP and others never will. I dunno if that's really surprising, though. I think that techni...
null
CC BY-SA 2.5
null
2008-08-23T15:06:40.197
2008-08-23T15:06:40.197
null
null
2,131
null
24,288
2
null
24,270
6
null
@Sean > However, factoring out common finctionality into a base class, then reusing that in other descendant classes is a deeply elegant thing, IMHO! But "procedural" developers have been doing that for decades anyway. The syntax and terminology might differ, but the effect is identical. There is more to OOP than "...
null
CC BY-SA 2.5
null
2008-08-23T15:08:58.460
2008-08-23T15:08:58.460
null
null
2,131
null
24,293
2
null
24,270
14
null
Its a programming paradigm.. Designed to make it easier for us mere mortals to break down a problem into smaller, workable pieces.. If you dont find it useful.. Don't use it, don't pay for training and be happy. I on the other hand do find it useful, so I will :)
null
CC BY-SA 2.5
null
2008-08-23T15:14:09.337
2008-08-23T15:14:09.337
null
null
832
null
24,291
2
null
24,270
1
null
"Even if there is no actual [information architecture], it doesn’t mean we don’t experience or perceive it as such. Zen Buddhists say there is no actual “self” but they still name their kids."-Andrew Hinton
null
CC BY-SA 2.5
null
2008-08-23T15:11:50.920
2008-08-23T15:11:50.920
null
null
279
null
24,302
2
null
24,298
22
null
I would really recommend [Restful Authentication](http://github.com/technoweenie/restful-authentication/tree/master). I think it's pretty much the de-facto standard.
null
CC BY-SA 2.5
null
2008-08-23T15:33:44.937
2008-08-23T15:33:44.937
null
null
1,450
null
24,298
1
741,170
null
84
56,474
I'm looking for a pre-built solution I can use in my RoR application. I'm ideally looking for something similar to the ASP.NET Forms authentication that provides email validation, sign-up controls, and allows users to reset their passwords. Oh yeah, and easily allows me to pull the user that is currently logged into ...
Best Solution For Authentication in Ruby on Rails
CC BY-SA 2.5
0
2008-08-23T15:27:11.647
2013-04-20T04:49:31.190
2008-08-24T20:57:42.467
234
168
[ "ruby-on-rails", "ruby", "authentication" ]
24,284
2
null
24,270
7
null
I have been writing OO code for the last 9 years or so. Other than using messaging, it's hard for me to imagine other approach. The main benefit I see totally in line with what CodingTheWheel said: modularisation. OO naturally leads me to construct my applications from modular components that have clean interfaces a...
null
CC BY-SA 2.5
null
2008-08-23T15:02:58.273
2008-08-23T15:02:58.273
null
null
2,608
null
24,296
2
null
23,930
7
null
# D Templates: Functional ``` template factorial(int n : 1) { const factorial = 1; } template factorial(int n) { const factorial = n * factorial!(n-1); } ``` or ``` template factorial(int n) { static if(n == 1) const factorial = 1; else const factorial = n * factorial!(n-1); } ``` ...
null
CC BY-SA 2.5
null
2008-08-23T15:22:08.617
2009-01-30T18:22:29.170
2009-01-30T18:22:29.170
1,337
1,337
null
24,308
2
null
24,270
14
null
Relative to straight procedural programming, the first fundamental tenet of OOP is the notion of information hiding and encapsulation. This idea leads to the notion of the that seperates the interface from implementation. These are hugely important concepts and the basis for putting a framework in place to think about...
null
CC BY-SA 2.5
null
2008-08-23T15:43:04.120
2008-08-24T12:51:08.720
2008-08-24T12:51:08.720
1,553
1,553
null
24,294
2
null
24,279
94
null
One key feature in a functional language is the concept of first-class functions. The idea is that you can pass functions as parameters to other functions and return them as values. Functional programming involves writing code that does not change state. The primary reason for doing so is so that successive calls to a...
null
CC BY-SA 2.5
null
2008-08-23T15:19:17.390
2008-08-23T15:39:15.767
2008-08-23T15:39:15.767
658
658
null
24,307
2
null
24,130
0
null
If your code uses lot of functions that operate on those attributes (name/height/weight), then using class could be a good option.
null
CC BY-SA 2.5
null
2008-08-23T15:42:51.717
2008-08-23T15:42:51.717
null
null
1,897
null
24,305
2
null
24,200
1
null
I think that it sounds like this could be done using [SSIS packages](http://msdn.microsoft.com/en-us/library/ms141026.aspx). They're similar to SQL 2000's DTS packages. I've used them to successfully transform everything from plain text CSV files, from existing SQL tables, and even from XLS files with 6-digit rows span...
null
CC BY-SA 2.5
null
2008-08-23T15:40:00.197
2008-08-23T15:40:00.197
null
null
1,414
null
24,311
2
null
24,310
10
null
The IRC Specification is laid out in RFC 1459 [http://www.irchelp.org/irchelp/rfc/rfc.html](http://www.irchelp.org/irchelp/rfc/rfc.html)
null
CC BY-SA 2.5
null
2008-08-23T15:49:53.510
2008-08-23T15:49:53.510
null
null
1,965
null
24,287
2
null
24,279
6
null
May be worth checking out this article on [F# "101"](http://www.code-magazine.com/Article.aspx?quickid=0809051) on CoDe Mag recently posted. Also, [Dustin Campbell has a great blog](http://diditwith.net/) where he has posted many articles on his adventures on getting up to speed with F#.. I hope you find these useful :...
null
CC BY-SA 2.5
null
2008-08-23T15:08:20.897
2008-08-23T15:08:20.897
2020-06-20T09:12:55.060
-1
832
null
24,301
2
null
24,279
3
null
I prefer to use functional programming to save myself repeated work, by making a more abstract version and then using that instead. Let me give an example. In Java, I often find myself creating maps to record structures, and thus writing getOrCreate structures. ``` SomeKindOfRecord<T> getOrCreate(T thing) { if(...
null
CC BY-SA 4.0
null
2008-08-23T15:31:48.297
2020-01-15T14:53:25.967
2020-01-15T14:53:25.967
3,446,255
279
null
24,310
1
844,821
null
11
12,248
I started using IRC at a young age, and I have always been fascinated with it. As a language exercise, I was thinking about programming a simple IRC client in Ruby with [Shoes](http://www.shoooes.net/) as a graphical front-end. My question to you, kind-sirs, what do I need to become familiar with to start on this gre...
Programming a simple IRC (Internet-Relay-Chat) Client
CC BY-SA 2.5
0
2008-08-23T15:49:06.960
2013-09-26T06:34:55.157
2010-04-17T09:52:26.880
13,992
25
[ "ruby", "shoes", "irc" ]
24,300
2
null
23,930
2
null
Recursive ``` def fact(x): return (1 if x==0 else x * fact(x-1)) ``` Using iterator ``` import operator def fact(x): return reduce(operator.mul, xrange(1, x+1)) ```
null
CC BY-SA 2.5
null
2008-08-23T15:31:41.573
2009-02-23T01:08:37.230
2009-02-23T01:08:37.230
3,002
1,013
null
24,315
1
null
null
7
2,512
In C# I can use the FileSystemWatcher object to watch for a specific file and raise an event when it is created, modified, etc. The problem I have with this class is that it raises the event the moment the file becomes created, even if the process which created the file is still in the process of writing. I have found...
Is It Possible To Raise An Event When A File Becomes Accessible?
CC BY-SA 2.5
0
2008-08-23T15:54:56.727
2009-07-12T01:33:20.683
null
null
392
[ "c#", ".net", "file-io" ]
24,316
2
null
24,270
5
null
@Jeff > Relative to straight procedural programming, the first fundamental tenet of OOP is the notion of information hiding and encapsulation. This idea leads to the notion of the class that seperates the interface from implementation. Which has the more hidden implementation: C++'s iostreams, or C's FILE*s? I think...
null
CC BY-SA 2.5
null
2008-08-23T15:54:57.743
2008-08-23T15:54:57.743
null
null
2,131
null
24,320
2
null
24,270
0
null
OOP reduced costs, and increased efficiency. When I made the jump from classic ASP/VBScript to C# I noticed a HUGE increase in productivity thanks to OOP.
null
CC BY-SA 2.5
null
2008-08-23T15:57:02.963
2008-08-23T15:57:02.963
null
null
1,965
null
24,322
2
null
24,310
7
null
> I found this gem on Wikipedia. Sounds intimidating. It's actually not. Telnet onto an IRC Server and witness the simplicity of the protocol first hand. The hardest part is the handshake, after that its very simple.
null
CC BY-SA 2.5
null
2008-08-23T15:59:07.420
2008-08-23T15:59:07.420
null
null
1,965
null
24,323
2
null
24,315
0
null
Not sure if there is a way of an event actually being raised by the standard class, but I eas experiencing similar problems on some recent work I was doing. In short, I was trying to write to a file that was locked at the time. I ended up wrapping the write method up so it would automatically try the write again in a ...
null
CC BY-SA 2.5
null
2008-08-23T15:59:13.660
2008-08-23T15:59:13.660
null
null
832
null
24,313
2
null
21,294
30
null
I used a [much less complicated version recently](http://gist.github.com/4102) with [jQuery](http://jquery.com/): ``` <script src="scripts/jquery.js"></script> <script> var js = ["scripts/jquery.dimensions.js", "scripts/shadedborder.js", "scripts/jqmodal.js", "scripts/main.js"]; var $head = $("head"); for (var i...
null
CC BY-SA 3.0
null
2008-08-23T15:52:48.607
2016-03-30T00:41:57.080
2016-03-30T00:41:57.080
3,386,807
1,414
null
24,335
2
null
24,221
14
null
Anders gives a good summary, and here's an example of a JUnit annotation ``` @Test(expected=IOException.class) public void flatfileMissing() throws IOException { readFlatFile("testfiles"+separator+"flatfile_doesnotexist.dat"); } ``` Here the `@Test` annotation is telling JUnit that the `flatfileMissing` method i...
null
CC BY-SA 3.0
null
2008-08-23T16:16:19.283
2016-11-22T08:37:54.190
2016-11-22T08:37:54.190
1,672,920
1,694
null
24,331
2
null
24,270
21
null
> I think the use of opaque context objects (HANDLEs in Win32, FILE*s in C, to name two well-known examples--hell, HANDLEs live on the other side of the kernel-mode barrier, and it really doesn't get much more encapsulated than that) is found in procedural code too; I'm struggling to see how this is something particula...
null
CC BY-SA 2.5
null
2008-08-23T16:05:08.200
2008-08-23T16:05:08.200
null
null
1,968
null
24,343
2
null
23,930
2
null
two of many Mathematica solutions (although ! is built-in and efficient): ``` (* returns pure function *) (FixedPoint[(If[#[[2]]>1,{#[[1]]*#[[2]],#[[2]]-1},#])&,{1,n}][[1]])& (* not using built-in, returns pure function, don't use: might build 1..n list *) (Times @@ Range[#])& ```
null
CC BY-SA 2.5
null
2008-08-23T16:27:07.307
2008-08-23T20:16:37.020
2008-08-23T20:16:37.020
279
279
null
24,338
2
null
20,185
0
null
If you are using this class in a seperate service assembly, you can use the internal keyword. ``` public class AbstractClass { public AbstractClass ClassFactory(string args) { switch (args) { case "A": return new ConcreteClassA(); case "B":...
null
CC BY-SA 2.5
null
2008-08-23T16:21:15.293
2008-08-23T16:58:43.580
2008-08-23T16:58:43.580
1,965
1,965
null
24,346
2
null
16,963
1
null
I have never used it. I completely agree, it's bloatware. I usually end up using the repeater with custom controls that i made.
null
CC BY-SA 2.5
null
2008-08-23T16:28:07.740
2008-08-23T16:28:07.740
null
null
1,632
null
24,355
2
null
14,697
1
null
I just installed [Helicon's ISAPI Rewrite 3](http://www.helicontech.com/isapi_rewrite/). Works exactly like htaccess. I'm diggin it so far.
null
CC BY-SA 2.5
null
2008-08-23T16:36:40.590
2008-08-23T16:36:40.590
null
null
2,614
null
24,336
2
null
24,315
0
null
Use [CreateFile](http://msdn.microsoft.com/en-us/library/aa363858.aspx) in a loop with OPEN_ EXISTING flag and FILE_ ALL_ ACCESS (or you might need only a subset, see [http://msdn.microsoft.com/en-us/library/aa364399(VS.85).aspx](http://msdn.microsoft.com/en-us/library/aa364399(VS.85).aspx) Examine the handle returned...
null
CC BY-SA 2.5
null
2008-08-23T16:16:49.110
2008-08-23T16:16:49.110
null
null
1,490
null
24,349
2
null
24,270
1
null
> HANDLEs (and the rest of the WinAPI) is OOP! Are they, though? They're not inheritable, they're certainly not substitutable, they lack well-defined classes... I think they fall a long way short of "OOP".
null
CC BY-SA 2.5
null
2008-08-23T16:31:57.497
2008-08-23T16:31:57.497
null
null
2,131
null
24,364
2
null
24,298
3
null
There's also [RestfulOpenIDAuthentication](http://github.com/ReinH/restful_open_id_authentication/tree/master) if you want OpenID support in addition to password support.
null
CC BY-SA 2.5
null
2008-08-23T16:46:52.017
2008-08-23T16:46:52.017
null
null
1,190
null
24,361
2
null
24,270
11
null
> > HANDLEs (and the rest of the WinAPI) is OOP!Are they, though? They're not inheritable, they're certainly not substitutable, they lack well-defined classes... I think they fall a long way short of "OOP". Have you ever created a window using WinAPI? Then you should know that you define a class (`RegisterClass`), crea...
null
CC BY-SA 2.5
null
2008-08-23T16:42:13.230
2008-08-23T16:42:13.230
2020-06-20T09:12:55.060
-1
1,968
null
24,369
2
null
11,720
3
null
Checkout [Powershell Management library for Hyper-V on CodePlex](http://www.codeplex.com/PSHyperv). Some features: > Finding a VM Connecting to a VM Discovering and manipulating Machine states Backing up, exporting and snapshotting VMs Adding and removing VMs, configuring motherboard settings. Manipulating D...
null
CC BY-SA 2.5
null
2008-08-23T16:50:42.273
2008-08-23T16:50:42.273
null
null
1,287
null
24,372
2
null
22,901
0
null
That depends a bit on what you want to do. First, check out libraries that provide connectivity to more than on DBMS platform. For example, Qt makes it very easy to connect to MySQL, MS SQL Server and a bunch of others, and change the database driver (connection type) at runtime - with just a few lines of code. MySQL...
null
CC BY-SA 2.5
null
2008-08-23T16:52:39.477
2008-08-23T16:52:39.477
null
null
1,304
null
24,334
2
null
23,094
7
null
You can try using the [HttpResponse.Cache property](http://msdn.microsoft.com/en-us/library/system.web.httpresponse.cache.aspx) if that would help: ``` Response.Cache.SetExpires(DateTime.Now.AddSeconds(60)); Response.Cache.SetCacheability(HttpCacheability.Public); Response.Cache.SetValidUntilExpires(false); Response.C...
null
CC BY-SA 2.5
null
2008-08-23T16:10:11.200
2008-08-23T16:31:36.250
2008-08-23T16:31:36.250
1,414
1,414
null
24,362
2
null
24,270
42
null
> All too often, the class is used simply for its syntactic sugar; it puts the functions for a record type into their own little namespace. Yes, I find this to be too prevalent as well. This is not Object Oriented Programming. It's Object Based Programming and data centric programing. In my 10 years of working...
null
CC BY-SA 2.5
null
2008-08-23T16:42:45.053
2008-08-23T16:42:45.053
null
null
1,644
null
24,392
2
null
18,326
4
null
Komodo from Activestate is a good IDE for Windows/Linux. There is a trial version - I am not sure if there is a free version after trial though.
null
CC BY-SA 2.5
null
2008-08-23T17:09:48.297
2008-08-23T17:09:48.297
null
null
2,617
null
24,388
2
null
16,963
1
null
For anything long term I would try to avoid datagrid/gridview, it sometimes becomes too hacky making it do exactly what you want, after a certain number of these tweaks you start to realise its not saving time in the long run and you might not be getting the control over markup that you need. However the built in pagi...
null
CC BY-SA 2.5
null
2008-08-23T17:07:07.180
2008-08-23T17:07:07.180
null
null
1,952
null
24,337
2
null
23,867
10
null
It seems to be a common design pattern in .NET code. Here is a citation from [Framework design guidelines](https://rads.stackoverflow.com/amzn/click/com/0321246756) > Consider providing method Close(), in addition to the Dispose(), if close is standard terminology in the area. When doing so, it is important that you ...
null
CC BY-SA 2.5
null
2008-08-23T16:19:56.747
2008-08-23T16:19:56.747
null
null
1,196
null
24,353
2
null
22,909
2
null
You could also try [http://motionandcolor.com/](http://motionandcolor.com/) > Wrapper is a cross-browser compliant HTML/CSS rendering engine written in ActionScript that sits on top of your standards compliant HTML page. Javascript might be tricker though.
null
CC BY-SA 2.5
null
2008-08-23T16:35:19.750
2008-08-23T16:35:19.750
null
null
914
null
24,396
2
null
22,909
1
null
[@JasonBunting](https://stackoverflow.com/questions/22909/is-there-some-way-to-show-html-content-inside-flash#22930) > > Here is a decent article on how to accomplish that. That's not a great article - it's seven years old and doesn't mention the CSS capabilities of Flash. It covers only the basics of HTML support in...
null
CC BY-SA 2.5
null
2008-08-23T17:13:01.347
2008-08-23T17:13:01.347
2017-05-23T12:13:57.183
-1
137
null
24,406
2
null
11,831
5
null
Holy wars! Ok let me see.. Last time I checked the design police said.. Singletons are bad because they hinder auto testing - instances cannot be created afresh for each test case. Instead the logic should be in a class (A) that can be easily instantiated and tested. Another class (B) should be responsible for constra...
null
CC BY-SA 2.5
null
2008-08-23T17:22:32.087
2008-08-23T17:22:32.087
null
null
1,695
null
24,401
2
null
22,519
0
null
You'll have to grant write permissions, but you can check the file's mime type to ensure an image. You can use FSO as so: ``` set fs=Server.CreateObject("Scripting.FileSystemObject") set f=fs.GetFile("upload.jpg") 'image mime types or image/jpeg or image/gif, so just check to see if "image" is instr if instr(f.type, ...
null
CC BY-SA 2.5
null
2008-08-23T17:17:00.650
2008-08-23T17:17:00.650
null
null
2,614
null
24,377
2
null
19,151
744
null
Iterator objects in python conform to the iterator protocol, which basically means they provide two methods: `__iter__()` and `__next__()`. - The `__iter__` returns the iterator object and is implicitly called at the start of loops.- The `__next__()` method returns the next value and is implicitly called at each l...
null
CC BY-SA 4.0
null
2008-08-23T16:57:28.637
2019-10-30T09:16:29.387
2019-10-30T09:16:29.387
2,467,424
2,611
null
24,408
1
24,841
null
3
337
Is there any way to have something that looks just like a file on a Windows file share, but is really a resource served up over HTTP? For context, I'm working with an old app that can only deal with files on a Windows file share, I want to create a simple HTTP-based service to serve the content of the files dynamically...
Database query representation impersonating file on Windows share?
CC BY-SA 4.0
0
2008-08-23T17:24:48.760
2020-12-24T11:51:44.117
2020-12-24T11:51:44.117
466,862
2,362
[ "file", "http", "webdav" ]
24,414
1
25,826
null
1
854
Anyone know of a way to capture keyboard events (keyup / keydown) in Portable IE under Window mobile? I noticed that key events are not supported in JS, and would like to come up with a solution that works without any client side additions.
Can I capture Windows Mobile PIE keyboard events?
CC BY-SA 2.5
null
2008-08-23T17:30:23.020
2015-01-22T18:22:52.260
2015-01-22T18:22:52.260
3,204,551
2,621
[ "internet-explorer", "windows-mobile", "key-events" ]
24,431
2
null
23,899
1
null
Is there any chance you could move from ASP to ASP.Net? Or are you looking at keeping it in classic ASP, but just cleaning it up. If at all possible, I would recommend moving as much as possible moving to .Net. It looks like you may be rewriting/reorganizing a lot of code anyway, so moving to .Net may not be a lot of...
null
CC BY-SA 2.5
null
2008-08-23T17:46:22.390
2008-08-23T17:46:22.390
null
null
1,862
null
24,442
2
null
24,270
45
null
OOP isn't about creating re-usable classes, its about creating Usable classes.
null
CC BY-SA 2.5
null
2008-08-23T18:04:49.520
2008-08-23T18:04:49.520
null
null
580
null
24,439
1
24,687
null
3
215
Is it possible to develop a plug-in for Internet Explorer that can replace the existing favorites functionality?
IE 7+ Favorites
CC BY-SA 2.5
0
2008-08-23T17:54:12.260
2015-09-06T16:07:35.283
null
null
2,141
[ "internet-explorer", "bookmarks", "favorites" ]
24,370
2
null
2,027
20
null
uses pass-by-value, but since all such values are object references, the net effect is something akin to pass-by-reference. However, Python programmers think more about whether an object type is or . Mutable objects can be changed in-place (e.g., dictionaries, lists, user-defined objects), whereas immutable objects c...
null
CC BY-SA 2.5
null
2008-08-23T16:50:59.403
2008-08-23T17:53:47.160
2008-08-23T17:53:47.177
726
726
null
24,443
2
null
12,815
1
null
I've found that using [contracts](http://blog.mauricecodik.com/2005/10/ruby-meta-programming-software.html) is a great approach. Metaprogramming contracts are generally lower-level than the types of integration tests you describe, but the two are certainly not mutually exclusive. I find contracts help keep documentat...
null
CC BY-SA 2.5
null
2008-08-23T18:05:59.143
2008-08-23T18:05:59.143
null
null
1,190
null
24,440
2
null
24,279
2
null
If you are looking for a good text on F# [Expert F#](http://www.apress.com/book/view/9781590598504) is co-written by Don Syme. Creator of F#. He worked on generics in .NET specifically so he could create F#. F# is modeled after OCaml so any OCaml text would help you learn F# as well.
null
CC BY-SA 2.5
null
2008-08-23T17:54:14.040
2008-08-23T17:54:14.040
null
null
580
null
24,398
2
null
24,270
4
null
> Have you ever created a window using WinAPI? More times than I care to remember. > Then you should know that you define a class (RegisterClass), create an instance of it (CreateWindow), call virtual methods (WndProc) and base-class methods (DefWindowProc) and so on. WinAPI even takes the nomenclature from SmallTalk...
null
CC BY-SA 2.5
null
2008-08-23T17:13:26.993
2008-08-23T17:13:26.993
null
null
2,131
null
24,437
2
null
24,408
0
null
This won't answer your question in any meaningful way, but maybe it will get you pointed in the right direction. Look into serving the "file(s)" via WebDAV--SharePoint uses this and its files can be accessed exactly as you want, as a file share where the transport mechanism is HTTP. Unfortunately I can't give any mor...
null
CC BY-SA 2.5
null
2008-08-23T17:52:40.190
2008-08-23T20:51:36.873
2008-08-23T20:51:36.873
205
205
null
24,446
2
null
22,880
4
null
Ensure you don't use incremting integers for session IDs. Much better to use a GUID, or some other long randomly generated character string.
null
CC BY-SA 2.5
null
2008-08-23T18:10:25.840
2008-08-23T18:10:25.840
null
null
1,862
null
24,449
2
null
24,200
3
null
[BCP](http://www.databasejournal.com/features/mssql/article.php/3391761) - it's a pain to set up, but it's been around since the dawn of DBs and it's very very quick. Unless you're inserting data in that order the 3-part index will really slow things. Applying it later will really slow things too, but will be in a se...
null
CC BY-SA 2.5
null
2008-08-23T18:14:25.737
2008-08-23T18:28:03.943
2008-08-23T18:28:03.943
905
905
null
24,455
2
null
24,451
1
null
In Perl, use of a label to "goto" from a loop - using a "last" statement, which is similar to break. This allows better control over nested loops. The traditional goto is supported too, but I'm not sure there are too many instances where this is the only way to achieve what you want - subroutines and loops should su...
null
CC BY-SA 2.5
null
2008-08-23T18:22:08.933
2008-08-23T18:22:08.933
null
null
2,617
null
24,465
2
null
24,451
-1
null
The problem with 'goto' and the most important argument of the 'goto-less programming' movement is, that if you use it too frequently your code, although it might behave correctly, becomes unreadable, unmaintainable, unreviewable etc. In 99.99% of the cases 'goto' leads to spaghetti code. Personally, I cannot think of ...
null
CC BY-SA 2.5
null
2008-08-23T18:30:20.927
2008-08-23T18:30:20.927
null
null
2,386
null
24,445
2
null
22,880
42
null
The SSL only helps with sniffing attacks. If an attacker has access to your machine I will assume they can copy your secure cookie too. At the very least, make sure old cookies lose their value after a while. Even a successful hijaking attack will be thwarted when the cookie stops working. If the user has a cookie f...
null
CC BY-SA 2.5
null
2008-08-23T18:07:32.603
2008-08-23T18:07:32.603
null
null
null
null
24,467
1
26,282
null
1
651
I'm developing a web- application using NHibernate. Can you tell me how to write a NHibernate Query for the following SQL query: ``` SELECT v1.Id FROM VIEW v1 LEFT JOIN VIEW v2 ON v1.SourceView = v2.Id ORDER BY v1.Position ``` It's basically a auto-join but I don't know how to write this in Nhibernate. Lets say the ...
(N)Hibernate Auto-Join
CC BY-SA 3.0
null
2008-08-23T18:31:02.187
2012-01-03T19:14:35.387
2012-01-03T19:14:35.387
249,833
2,078
[ "sql", "nhibernate", "orm" ]
24,451
1
24,476
null
220
55,841
I've long been under the impression that `goto` should never be used if possible. However, while perusing libavcodec (which is written in C) the other day, I was surprised to notice multiple uses of it. Is it ever advantageous to use `goto` in a language that supports loops and functions? If so, why? Please provide ...
Are there any legitimate use-cases for "goto" in a language that supports loops and functions?
CC BY-SA 4.0
0
2008-08-23T18:18:04.933
2022-08-23T07:22:45.367
2021-11-04T04:04:53.093
366,904
1,597
[ "language-agnostic", "goto" ]
24,466
2
null
24,451
8
null
The rule with goto that we use is that goto is okay to for jumping forward to a single exit cleanup point in a function. In really complex functions we relax that rule to allow other jump forwards. In both cases we are avoiding deeply nested if statements that often occur with error code checking, which helps readabili...
null
CC BY-SA 2.5
null
2008-08-23T18:30:28.413
2008-08-23T18:30:28.413
null
null
2,564
null
24,456
1
24,517
null
2
3,042
I'm trying to embed a IPTC data onto a JPEG image using `iptcembed()` but am having a bit of trouble. I have verified it is in the end product: ``` // Embed the IPTC data $content = iptcembed($data, $path); // Verify IPTC data is in the end image $iptc = iptcparse($content); var_dump($iptc); ``` Which returns the ...
Embedding IPTC image data with PHP GD
CC BY-SA 3.0
0
2008-08-23T18:24:21.643
2018-08-31T12:03:43.417
2013-12-02T12:43:45.123
2,432,317
2,025
[ "php", "gd", "iptc" ]
24,470
1
40,434
null
131
195,267
Trying to find some simple SQL Server PIVOT examples. Most of the examples that I have found involve counting or summing up numbers. I just want to pivot some string data. For example, I have a query returning the following. ``` Action1 VIEW Action1 EDIT Action2 VIEW Action3 VIEW Action3 EDIT ``` I would ...
SQL Server: Examples of PIVOTing String data
CC BY-SA 3.0
0
2008-08-23T18:36:33.953
2019-02-28T03:50:28.720
2016-02-01T11:00:53.117
777,939
2,626
[ "sql-server", "tsql", "pivot" ]
24,436
2
null
22,566
1
null
Similar to the above, but I think the best version is (slightly modified) from "perldoc -f readdir": ``` opendir(DIR, $somedir) || die "can't opendir $somedir: $!"; @dots = grep { (!/^\./) && -f "$somedir/$_" } readdir(DIR); closedir DIR; ```
null
CC BY-SA 2.5
null
2008-08-23T17:50:40.180
2008-08-23T17:50:40.180
null
null
2,620
null
24,447
2
null
3,088
1
null
I'd recommend Charles Petzold's book [Code - The Hidden Langauge of Computer Hardware and Software](http://books.google.com/books?id=l4gpAAAACAAJ&dq=petzold+code&ei=2U-wSL_hNoLmygSxpcmoDQ) as an excellent general introduction to how computers work. There's a of information in the book (382 pages) and it may take an a...
null
CC BY-SA 2.5
null
2008-08-23T18:14:19.297
2008-08-23T18:14:19.297
null
null
1,518
null
24,429
2
null
24,315
5
null
You can use a file system watcher to check when the file has been changed. It only becomes "changed" after whichever program had the file previously closes the file. I know you asked for C#, but my VB.Net is much better. Hope you or someone else can translate. It tries to open the file, if it isn't available, it add...
null
CC BY-SA 2.5
null
2008-08-23T17:38:59.397
2008-08-23T17:51:41.660
2008-08-23T17:51:41.660
1,862
1,862
null
24,477
2
null
24,468
5
null
With .NET 3.5 SP1, .NET assemblies running from UNC shares have full permissions. See Brad Abrams's [Allow .exes to be run off a network shares](http://blogs.msdn.com/brada/archive/2007/10/26/adhoc-poll-allowing-net-exes-to-run-off-a-network-share.aspx) for workaround and discussions, and finally the follow up [.NET ...
null
CC BY-SA 2.5
null
2008-08-23T18:42:49.883
2008-08-23T18:42:49.883
null
null
536
null
24,468
1
24,477
null
11
8,661
When I try to run a .NET assembly (`boo.exe`) from a network share (mapped to a drive), it fails since it's only partially trusted: ``` Unhandled Exception: System.Security.SecurityException: That assembly does not allow partially trusted callers. at System.Security.CodeAccessSecurityEngine.ThrowSecurityException(A...
Running "partially trusted" .NET assemblies from a network share
CC BY-SA 3.0
0
2008-08-23T18:33:55.287
2013-07-05T08:56:41.580
2013-07-05T08:56:41.580
1,584,286
616
[ ".net", "security" ]
24,472
2
null
5,263
2
null
I don't know ADO.net in particular, but most ORMs won't automatically insert the ID of a new record in a relationship. You'll have to resort to the 2-step process: 1. build and save parent 2. build and save child with relationship to parent The reason that this is difficult for ORMs is because you might have circ...
null
CC BY-SA 2.5
null
2008-08-23T18:37:59.287
2008-08-23T18:37:59.287
null
null
1,190
null
24,482
2
null
22,792
0
null
Update On Sourceforge I found [Whiz SQL Structure Compare](http://sourceforge.net/projects/whiz/) with this description: Whiz is a database diff utility which will be useful to find difference between two MS-SQL Server databases. It also able to generate SQL script to update the changes from one database to another da...
null
CC BY-SA 2.5
null
2008-08-23T18:46:26.520
2008-08-23T18:46:26.520
null
null
1,463
null
24,475
2
null
24,451
35
null
Since `goto` makes reasoning about program flow hard (aka. “spaghetti code”), `goto` is generally only used to compensate for missing features: The use of `goto` may actually be acceptable, but only if the language doesn't offer a more structured variant to obtain the same goal. Take Doubt's example: > The rule with g...
null
CC BY-SA 3.0
null
2008-08-23T18:40:03.697
2014-11-17T14:31:02.183
2014-11-17T14:31:02.183
1,968
1,968
null