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
10,890
2
null
10,880
16
null
No specific article, really, but I've found [EmacsWiki](http://www.emacswiki.org/cgi-bin/wiki) to be full of useful information. Consider checking out these entries: - [CPlusPlus](http://www.emacswiki.org/cgi-bin/wiki/CPlusPlus)- [CppTemplate](http://www.emacswiki.org/cgi-bin/wiki/CppTemplate)
null
CC BY-SA 2.5
null
2008-08-14T11:04:13.680
2008-08-14T11:04:13.680
null
null
1,199
null
10,778
2
null
5,966
7
null
OK, what you need is `classobj` from new module. That would allow you to construct exception classes dynamically (`classobj` takes a string as an argument for the class name). ``` import new myexc=new.classobj("ExcName",(Exception,),{}) i=myexc("This is the exc msg!") raise i ``` this gives you: ``` Traceback (mos...
null
CC BY-SA 3.0
null
2008-08-14T07:08:19.280
2012-10-29T20:55:28.867
2012-10-29T20:55:28.867
321,731
985
null
10,887
2
null
10,877
31
null
The CSS for styling lists is [here](http://www.w3.org/TR/REC-CSS2/generate.html#lists), but is basically: ``` li { list-style-type: decimal; list-style-position: inside; } ``` However, the specific layout you're after can probably only be achieved by delving into the innards of the layout with something like...
null
CC BY-SA 3.0
null
2008-08-14T11:01:30.880
2016-01-14T19:18:09.093
2016-01-14T19:18:09.093
2,678,454
1,000
null
10,892
2
null
9,033
7
null
In addition to duncansmart's reply, also extension methods can be used on Framework 2.0. Just add an `ExtensionAttribute` class under System.Runtime.CompilerServices namespace and you can use extension methods (only with C# 3.0 of course). ``` namespace System.Runtime.CompilerServices { public class ExtensionAttri...
null
CC BY-SA 2.5
null
2008-08-14T11:07:01.447
2010-05-19T15:01:55.763
2010-05-19T15:01:55.763
63,550
31,505
null
10,893
2
null
10,855
54
null
As @ch00k said: ``` using System.Data; //needed for the extension methods to work ... var results = from myRow in myDataTable.Rows where myRow.Field<int>("RowNo") == 1 select myRow; //select the thing you want, not the collection ``` You also need to add a project reference to `System.Data.DataSetEx...
null
CC BY-SA 2.5
null
2008-08-14T11:07:52.613
2008-08-14T11:07:52.613
null
null
905
null
10,895
2
null
9,938
1
null
Better late than never... The latest issue of [C-Vu](http://accu.org/index.php/aboutus/aboutjournals) turned up and guess what was in it: That's right, iterators that do what you wanted. Unfortunately you need to become a member of the [ACCU](http://accu.org/) to view the magazine (the article references the Overloa...
null
CC BY-SA 2.5
null
2008-08-14T11:09:02.690
2008-08-14T11:09:02.690
null
null
342
null
10,829
2
null
10,668
1
null
Manipulating a process's memory behind its back is a Bad Thing and is fraught with peril. That's why Mac OS X (like any Unix system) has protected memory, and keeps processes isolated from one another. Of course it can be done: There are facilities for shared memory between processes that explicitly cooperate. Ther...
null
CC BY-SA 2.5
null
2008-08-14T09:19:08.283
2008-08-14T09:19:08.283
null
null
714
null
10,896
2
null
10,872
2
null
Learning how to program is like learning spell casting at . The computer will be your servant forever... ## --if you have a Mac-- A simple start could be just to look at (are several screencasts online [ie](http://www.youtube.com/watch?v=aq2lEsG68JU)) which is a simple way of making programs do a little more than...
null
CC BY-SA 3.0
null
2008-08-14T11:09:46.027
2015-04-17T10:25:31.590
2020-06-20T09:12:55.060
-1
842
null
10,900
2
null
10,616
3
null
> Anyone have any good experience with a "port" of a database from SQL Server to MySQL? This should be fairly painful! I switched versions of MySQL from 4.x to 5.x and various statements wouldn't work anymore as they used to. The query analyzer was "improved" so statements which previously were tuned for performan...
null
CC BY-SA 2.5
null
2008-08-14T11:24:57.133
2008-08-14T11:24:57.133
null
null
198
null
10,904
2
null
10,901
1
null
Were you to look at moving to C# and therefore .NET, I would consider Windows Presentation Foundation rather than WinForms. WPF is the future of smart clients in .NET, and the skills you pick up you'll be able to reuse if you want to make browser-hosted Silverlight applications.
null
CC BY-SA 2.5
null
2008-08-14T11:28:23.570
2008-08-14T11:28:23.570
null
null
615
null
10,898
1
21,550
null
4
2,140
I need to create a linked server to a DB2 database on a mainframe. Has anyone done this successfully on a 64-bit version of SQL Server 2005? If so, which provider and settings were used? It's important that the linked server work whether we are using a Windows authenticated account to login to SQL Server or a SQL Serv...
How to set up a DB2 linked server on a 64-bit SQL Server 2005?
CC BY-SA 3.0
null
2008-08-14T11:18:39.113
2014-12-13T07:44:17.157
2014-12-13T07:44:17.157
1,810,429
162
[ "sql-server", "db2" ]
10,902
2
null
10,230
2
null
`String.IsNullOrEmpty()` only works on .net 2.0 and above, for .net 1/1.1, I tend to use: ``` if (inputString == null || inputString == String.Empty) { // String is null or empty, do something clever here. Or just expload. } ``` I use String.Empty as opposed to "" because "" will create an object, whereas String...
null
CC BY-SA 3.0
null
2008-08-14T11:26:53.060
2016-02-07T18:30:17.253
2016-02-07T18:30:17.253
2,921,691
1,276
null
10,906
2
null
10,905
0
null
I have a hack to workaround this, which works but isn't ideal: Add a new class to the project that inherits the form with its simple name. ``` internal class MyGenericForm: MyGenericForm<object> { } ``` This means that although the designer is still wrong the expected simple type (i.e without `<>`) is still fou...
null
CC BY-SA 2.5
null
2008-08-14T11:32:45.137
2008-08-14T11:32:45.137
null
null
905
null
10,907
2
null
10,905
21
null
Yes you can! Here's a blog post I made a while ago with the trick: [Designing Generic Forms](http://www.madprops.org/blog/designing-generic-forms/) Edit: Looks like you're already doing it this way. This method works fine so I wouldn't consider it too hacky.
null
CC BY-SA 2.5
null
2008-08-14T11:33:21.377
2008-08-14T11:33:21.377
null
null
615
null
10,905
1
10,907
null
32
13,572
You should be able to create a generic form: ``` public partial class MyGenericForm<T> : Form where T : class { /* form code */ public List<T> TypedList { get; set; } } ``` Is valid C#, and compiles. However the designer won't work and the form will throw a runtime exception if you have any images stati...
Can you use generic forms in C#?
CC BY-SA 2.5
0
2008-08-14T11:30:54.970
2020-02-04T09:03:29.703
2013-07-05T07:21:57.760
905
905
[ "c#", ".net", "winforms" ]
10,909
2
null
10,901
0
null
I concur with the WPF sentiment. Tag/XML based UI would seem to be a bit more portable than WinForms. I guess too you have to consider your team, if there is not a lot of current C# skills, then that is a factor, but going forward the market for MFC developers is diminishing and C# is growing. Maybe some kind of piec...
null
CC BY-SA 2.5
null
2008-08-14T11:36:47.173
2008-08-14T11:36:47.173
null
null
1,075
null
10,911
2
null
10,901
2
null
Depending on the application and the willingness of your customers to install .NET (not all of them are), I would definitely move to WinForms or WPF. Interop with C++ code is hugely simplified by refactoring non-UI code into class libraries using C++/CLI (as you've noted in your selection of tags). The only issue with...
null
CC BY-SA 2.5
null
2008-08-14T11:40:53.373
2008-08-14T11:40:53.373
null
null
891
null
10,901
1
11,004
null
12
4,175
My company has developed a long standing product using MFC in Visual C++ as the defacto standard for UI development. Our codebase contains ALOT of legacy/archaic code which must be kept operational. Some of this code is older than me (originally written in the late 70s) and some members of our team are still on Visual ...
Future proofing a large UI Application - MFC with 2008 Feature pack, or C# and Winforms?
CC BY-SA 2.5
0
2008-08-14T11:26:02.733
2009-02-25T22:41:07.390
2008-08-17T02:00:20.867
55
1,169
[ "c#", "c++", "winforms", "mfc", "user-interface" ]
10,914
2
null
10,891
2
null
The ATL consumer templates for OleDb are an option - start [here](http://msdn.microsoft.com/en-us/library/fk4h509a(VS.80).aspx). The ClassWizard is still there to assist you so the verbosity isn't too much of a hurdle at first. Very soon you will need to hand-code though. There is a lot of careful twiddling, for exampl...
null
CC BY-SA 2.5
null
2008-08-14T11:49:25.883
2008-08-14T11:49:25.883
null
null
1,042
null
10,916
2
null
10,793
1
null
Depending on where your errors are occurring you can do something like... ``` public abstract class SilentErrorControl : UserControl { protected override void Render( HtmlTextWriter writer ) { //call the base's render method, but with a try catch try { base.Render( writer ); } catch ( E...
null
CC BY-SA 2.5
null
2008-08-14T11:56:38.053
2008-08-14T11:56:38.053
null
null
905
null
10,915
1
11,164
null
3
14,459
Warning - I am very new to NHibernate. I know this question seems simple - and I'm sure there's a simple answer, but I've been spinning my wheels for some time on this one. I am dealing with a legacy db which really can't be altered structurally. I have a details table which lists payment plans that have been accepted ...
Best way to model Many-To-One Relationships in NHibernate When Dealing With a Legacy DB?
CC BY-SA 2.5
null
2008-08-14T11:56:29.550
2012-08-11T15:51:17.700
null
null
1,284
[ "c#", "nhibernate" ]
10,920
2
null
10,293
3
null
@Stu: Not necessarily, maybe there's a bunch of people using it and having no issues. I love the concept having to only write validations once, using one language for everything both client and server side sounds like a interesting approach.
null
CC BY-SA 2.5
null
2008-08-14T12:09:46.950
2008-08-14T12:09:46.950
null
null
567
null
10,932
2
null
8,351
1
null
Visual Studio 2008 can do JavaScript debugging, you have to go to IE's Tools->Internet Options->Advanced and uncheck 'Disable Script Debugging (Internet Explorer)' in order for the browser to bubble up the errors it detects. Once you're in Visual Studio you basically have it's entire debugging arsenal at your disposal...
null
CC BY-SA 2.5
null
2008-08-14T12:37:17.253
2008-08-14T12:37:17.253
null
null
37
null
10,919
1
10,922
null
8
2,330
Usually when I'm creating indexes on tables, I generally guess what the `Fill Factor` should be based on an educated guess of how the table will be used (many reads or many writes). Is there a more scientific way to determine a more accurate `Fill Factor` value?
How do you measure SQL Fill Factor value
CC BY-SA 3.0
0
2008-08-14T12:07:27.750
2013-07-04T12:09:25.020
2013-07-04T12:09:25.020
1,584,286
383
[ "sql-server", "fillfactor" ]
10,918
2
null
10,901
2
null
You don't give a lot of detail on what your legacy code does or how it's structured. If you have certain performance criteria you might want to maintain some of your codebase in C++. You'll have an easier time doing interop with your old code if it is exposed in the right way - can you call into the existing codebase f...
null
CC BY-SA 2.5
null
2008-08-14T12:04:56.460
2008-08-14T12:04:56.460
null
null
636
null
10,924
2
null
10,752
2
null
I call unit tests those tests that white box test a class. Any dependencies that class requires is replaced with fake ones (mocks). Integration tests are those tests where multiple classes and their interactions are tested at the same time. Only some dependencies in these cases are faked/mocked. I wouldn't call Contr...
null
CC BY-SA 2.5
null
2008-08-14T12:19:55.603
2008-08-14T12:19:55.603
null
null
209
null
10,922
2
null
10,919
12
null
You could try running a big list of realistic operations and looking at IO queues for the different actions. There are a lot of variables that govern it, such as the size of each row and the number of writes vs reads. Basically: high fill factor = quicker read, low = quicker write. However it's not quite that simple...
null
CC BY-SA 2.5
null
2008-08-14T12:16:03.770
2008-08-14T12:19:17.197
2008-08-14T12:19:17.197
905
905
null
10,951
2
null
10,919
2
null
I would tend to be of the opinion that if you're after performance improvements, your time is much better spent elsewhere, tweaking your schema, optimising your queries and ensuring good index coverage. Fill factor is one of those things that you only need to worry about when you that everything else in your system is...
null
CC BY-SA 2.5
null
2008-08-14T12:49:32.597
2008-08-14T12:49:32.597
null
null
1,030
null
10,935
1
10,969
null
0
609
I have a with some . Sometimes, this objects and register an error event in the Windows Event Log with lots of hexadecimal informations. I have no clue why this crashes happens. So, How can I trace those COM objects exceptions?
How to trace COM objects exceptions?
CC BY-SA 3.0
null
2008-08-14T12:41:43.190
2013-07-04T12:10:51.747
2013-07-04T12:10:51.747
1,584,286
1,100
[ "exception", "com", "dll", "trace" ]
10,933
1
10,988
null
10
4,656
We have an SVN repository running on a Windows server, and I want to link internal documentation, feature changes, bugs and so on to code changes. We've found WebSVN to be amazingly slow - the repository is too large for it (I think). The team using it is primarily coding in C#, and while some have experience with ot...
Can you recommend a good .NET web-based repository browser for SVN?
CC BY-SA 3.0
0
2008-08-14T12:37:21.013
2016-11-26T17:45:07.157
2016-11-26T17:42:06.923
63,550
905
[ ".net", "asp.net", "svn" ]
10,934
2
null
10,303
0
null
@Lance: if you have access to Visual FoxPro command line window, type: ``` SET TABLEVALIDATE 11 USE "YourTable" EXCLUSIVE && If the table is damaged VFP must display an error here PACK && To reindex the table and deleted "marked" records PACK MEMO && If you have memo fields ``` After doing that, the struct...
null
CC BY-SA 2.5
null
2008-08-14T12:39:24.643
2008-08-14T12:39:24.643
null
null
394
null
10,956
2
null
10,949
1
null
I'd just write a single test to determine if the clone was correct or not. If the class isn't sealed, you can create a harness for it by extending it, and then exposing all your internals within the child class. Alternatively, you could use reflection (yech), or use MSTest's Accessor generators. You need to clone yo...
null
CC BY-SA 2.5
null
2008-08-14T12:56:06.640
2008-08-14T12:56:06.640
null
null
null
null
10,969
2
null
10,935
2
null
The first step is to lookup the Fail code's hex value (E.G. E_FAIL 0x80004005). I've had really good luck with posting that value in Google to get a sense of what the error code means. Then, I just use trial and error to try to isolate the location in code that's failing, and the root cause of the failure.
null
CC BY-SA 2.5
null
2008-08-14T13:03:10.447
2008-08-14T13:03:10.447
null
null
733
null
10,967
2
null
9,376
10
null
We use ILMerge on the Microsoft application blocks - instead of 12 seperate DLL files, we have a single file that we can upload to our client areas, plus the file system structure is alot neater. After merging the files, I had to edit the visual studio project list, remove the 12 seperate assmeblies and add the singl...
null
CC BY-SA 2.5
null
2008-08-14T13:00:50.343
2008-08-14T13:00:50.343
null
null
1,276
null
10,949
1
null
null
11
4,209
Let's say I have a complex .NET class, with lots of arrays and other class object members. I need to be able to generate a deep clone of this object - so I write a Clone() method, and implement it with a simple BinaryFormatter serialize/deserialize - or perhaps I do the deep clone using some other technique which is m...
Unit tests for deep cloning
CC BY-SA 2.5
null
2008-08-14T12:49:03.440
2015-06-30T13:03:59.227
2008-08-23T20:00:05.047
2,134
987
[ "c#", ".net", "unit-testing" ]
10,972
2
null
9,376
0
null
We just started using ILMerge in our solutions that are redistributed and used in our other projects and so far so good. Everything seems to work okay. We even obfuscated the packaged assembly directly. We are considering doing the same with the MS Enterprise Library assemblies. The only real issue I see with it is ...
null
CC BY-SA 2.5
null
2008-08-14T13:04:08.620
2008-08-14T13:04:08.620
null
null
1,269
null
10,797
2
null
10,793
0
null
Global.asax and Application_Error? [http://www.15seconds.com/issue/030102.htm](http://www.15seconds.com/issue/030102.htm) Or the Page_Error Event on an individual Page only: [http://support.microsoft.com/kb/306355](http://support.microsoft.com/kb/306355) ``` void Page_Load(object sender, System.EventArgs e) { t...
null
CC BY-SA 2.5
null
2008-08-14T08:11:14.503
2008-08-14T08:16:49.297
2008-08-14T08:16:49.297
91
91
null
10,926
1
null
null
1
13,337
I'm building a listing/grid control in a `Flex` application and using it in a `.NET` web application. To make a really long story short I am getting XML from a webservice of serialized objects. I have a page limit of how many things can be on a page. I've taken a data grid and made it page, sort across pages, and ha...
Deleting / Replacing A Node in E4X (AS3 - Flex)
CC BY-SA 3.0
null
2008-08-14T12:27:00.003
2016-05-04T13:32:36.550
2015-12-16T05:34:00.980
1,213,296
1,290
[ "apache-flex", "actionscript-3", "e4x" ]
10,973
2
null
10,727
2
null
@ninesided: performance issues aside, it's also about using the right tool for the job. Given the choice to move the cursor out of your query into code, I would think 99 times out of 100 it would be better to put that looping logic into some sort of managed code. Doing so allows you to get the advantages of using a deb...
null
CC BY-SA 2.5
null
2008-08-14T13:05:04.733
2008-08-14T13:05:04.733
null
null
493
null
10,995
2
null
8,472
1
null
How about showing nine random geometric shapes, and asking the user to select the two squares, or two circles or something.. should be pretty easy to write, and easy to use as well.. There's nothing worse than having text you cannot read properly...
null
CC BY-SA 2.5
null
2008-08-14T13:25:45.970
2008-08-14T13:25:45.970
null
null
1,304
null
10,980
1
16,662
null
10
2,091
I have been looking into IKVMing Apache's FOP project to use with our .NET app. It's a commercial product, and looking into licensing, IKVM runs into some sticky areas because of its use of GNU Classpath. From what I've seen, no one can say for sure if this stuff can be used in a commercial product. Has anyone used ...
IKVM and Licensing
CC BY-SA 4.0
0
2008-08-14T13:16:37.580
2021-03-31T16:47:18.873
2021-03-31T16:47:18.873
9,193,372
96
[ "java", ".net", "ikvm", "gnu-classpath" ]
11,000
2
null
10,985
0
null
You could declare a function called "operator new" inside the Foo class which would block the access to the normal form of new. Is this the kind of behaviour you want ?
null
CC BY-SA 2.5
null
2008-08-14T13:28:17.243
2008-08-14T13:28:17.243
null
null
381
null
10,985
1
11,299
null
32
10,044
Does anyone know how I can, in platform-independent C++ code prevent an object from being created on the heap? That is, for a class "Foo", I want to prevent users from doing this: ``` Foo *ptr = new Foo; ``` and only allow them to do this: ``` Foo myfooObject; ``` Does anyone have any ideas? Cheers,
How to prevent an object being created on the heap?
CC BY-SA 3.0
0
2008-08-14T13:19:08.073
2021-06-13T11:53:26.187
2021-06-13T11:53:26.187
5,459,839
1,304
[ "c++", "stack", "heap-memory" ]
11,002
2
null
10,901
2
null
Thank you all kindly for your responses, it's reassuring to see that generally the consensus follows my line of thinking. I am in the fortunate situation that our software also runs on our own custom hardware (for the broadcast industry) - so the choice of OS is really ours and is thrust upon our customers. Currently w...
null
CC BY-SA 2.5
null
2008-08-14T13:30:47.177
2008-08-14T13:30:47.177
null
null
1,169
null
11,003
2
null
10,985
11
null
You could overload new for Foo and make it private. This would mean that the compiler would moan... unless you're creating an instance of Foo on the heap from within Foo. To catch this case, you could simply not write Foo's new method and then the linker would moan about undefined symbols. ``` class Foo { private: v...
null
CC BY-SA 2.5
null
2008-08-14T13:31:05.587
2008-08-14T14:04:34.690
2008-08-14T14:04:34.690
1,236
1,236
null
10,990
1
11,005
null
60
117,799
Sorry for the basic question - I'm a .NET developer and don't have much experience with LAMP setups. I have a PHP site that will allow uploads to a specific folder. I have been told that this folder needs to be owned by the webserver user for the upload process to work, so I created the folder and then set permissions...
What are the proper permissions for an upload folder with PHP/Apache?
CC BY-SA 3.0
0
2008-08-14T13:22:25.743
2022-08-29T16:48:40.660
2011-11-13T13:47:43.387
367,456
1,153
[ "php", "apache", "upload" ]
10,988
2
null
10,933
3
null
Have a look at [http://warehouseapp.com](http://warehouseapp.com) It's Mongrel/Ruby/MySQL stack (should work on Windows though) > but I'm looking to avoid installing MySQL and Ruby on the server. I know (also using C# stack myself), but self-hosted web-based SVN client market is such a small niche that even offeri...
null
CC BY-SA 3.0
null
2008-08-14T13:20:05.280
2016-11-26T17:43:47.847
2016-11-26T17:43:47.847
63,550
275
null
10,996
2
null
10,915
0
null
I don't know if this is possibly because my NHibernate experience is limited, but could you create a BaseDetail class which has just the properties for the Details as they map directly to the Detail table. Then create a second class that inherits from the BaseDetail class that has the additional Parent Plan object so ...
null
CC BY-SA 2.5
null
2008-08-14T13:25:49.340
2008-08-14T13:25:49.340
null
null
493
null
11,011
2
null
10,985
-1
null
Not sure if this offers any compile-time opportunities, but have you looked at overloading the 'new' operator for your class?
null
CC BY-SA 2.5
null
2008-08-14T13:35:29.087
2008-08-14T13:35:29.087
null
null
987
null
11,005
2
null
10,990
48
null
You can create a new group with both the apache user and FTP user as members and then make the permission on the upload folder 775. This should give both the apache and FTP users the ability to write to the files in the folder but keep everyone else from modifying them.
null
CC BY-SA 2.5
null
2008-08-14T13:32:55.473
2008-08-14T13:32:55.473
null
null
75
null
11,017
2
null
10,999
0
null
From my understanding you can have multiple TFS Application servers in different locations. They either can both talk to the same SQL Server or you could use SQL Server mirroring. Having your own local TFS server would likely speed up your development times.
null
CC BY-SA 2.5
null
2008-08-14T13:39:12.793
2008-08-14T13:39:12.793
null
null
200
null
11,022
2
null
10,985
0
null
You could declare it as an interface and control the implementation class more directly from your own code.
null
CC BY-SA 2.5
null
2008-08-14T13:41:58.543
2008-08-14T13:41:58.543
null
null
267
null
10,993
2
null
10,915
0
null
The approach I'd take to model this is as follows: Customer object contains an ICollection <PaymentPlan> PaymentPlans which represent the plans that customer has accepted. The PaymentPlan to the Customer would be mapped using a bag which uses the details table to establish which customer id's mapped to which PaymentP...
null
CC BY-SA 2.5
null
2008-08-14T13:23:43.993
2008-08-14T13:23:43.993
null
null
1,297
null
11,019
2
null
10,935
1
null
If you just want a really quick way to find out what the error code means, you could use the "Error Lookup" tool packaged with Visual Studio (details [here](http://msdn.microsoft.com/en-us/library/akay62ya(VS.80).aspx)). Enter the hex value, and it will give you the string describing that error code. Of course, once ...
null
CC BY-SA 2.5
null
2008-08-14T13:40:05.987
2008-08-14T13:40:05.987
null
null
863
null
11,025
2
null
10,990
1
null
I will add that if you are using SELinux that you need to make sure the type context is tmp_t You can accomplish this by using the chcon utility > chcon -t tmp_t uploads
null
CC BY-SA 2.5
null
2008-08-14T13:43:36.653
2008-08-14T13:43:36.653
null
null
312
null
11,014
2
null
10,985
8
null
I don't know how to do it reliably and in a portable way.. but.. If the object is on the stack then you might be able to assert within the constructor that the value of 'this' is always close to stack pointer. There's a good chance that the object will be on the stack if this is the case. I believe that not all plat...
null
CC BY-SA 2.5
null
2008-08-14T13:37:17.680
2008-08-14T13:40:34.553
2008-08-14T13:40:34.553
755
755
null
11,031
2
null
11,028
2
null
No this syntax stems from the days before joins were in the language. Not sure of the problems associated with it, but there are definitely language constructs that are more supported for jointing tables.
null
CC BY-SA 2.5
null
2008-08-14T13:46:23.790
2008-08-14T13:46:23.790
null
null
17
null
11,029
2
null
10,990
16
null
I would go with Ryan's answer if you really want to do this. In general on a *nix environment, you always want to err on giving away as little permissions as possible. 9 times out of 10, 755 is the ideal permission for this - as the only user with the ability to modify the files will be the webserver. Change this to ...
null
CC BY-SA 3.0
null
2008-08-14T13:45:04.903
2013-06-07T13:57:07.757
2013-06-07T13:57:07.757
75
1,309
null
11,018
2
null
10,985
4
null
@Nick This could be circumvented by creating a class that derives from or aggregates Foo. I think what I suggest (while not robust) would still work for derived and aggregating classes. E.g: ``` struct MyStruct { Foo m_foo; }; MyStruct* p = new MyStruct(); ``` Here I have created an instance of 'Foo' on the ...
null
CC BY-SA 2.5
null
2008-08-14T13:39:54.787
2008-08-14T13:52:48.287
2008-08-14T13:52:48.287
755
755
null
10,999
1
11,034
null
5
1,988
Is anyone out there using Team Foundation Server within a team that is geographically distributed? We're in the UK, trying work with a team in Australia and we're finding it quite tough. Our main two issues are: 1. Things are being checked out to us without us asking on a get latest. 2. Even when using a proxy, mos...
MS Team Foundation Server in distributed environments - hints tips tricks needed
CC BY-SA 3.0
0
2008-08-14T13:27:40.523
2017-01-31T20:52:07.657
2017-01-31T20:52:07.657
1,122
1,122
[ "visual-studio", "tfs" ]
11,023
2
null
10,515
1
null
@pix0r That actually annoyed the hell out of me too and nothing came close to Apache mod_rewrite. Because they all have this overly complex XML structure. So I actually took the time and wrote my own rewriter for IIS 6.0 and IIS 7.0. Non-.NET applications only works in IIS 7.0. [http://www.managedfusion.com/produc...
null
CC BY-SA 2.5
null
2008-08-14T13:42:07.827
2008-08-14T13:42:07.827
null
null
17
null
11,035
2
null
11,028
1
null
If you look at it from a mathematical point of view, your examples should yield the same results. a = b = c So your first example would yield the same results as the second, so no need to do the extra work.
null
CC BY-SA 3.0
null
2008-08-14T13:48:30.777
2013-11-03T09:15:43.210
2013-11-03T09:15:43.210
1,560,062
383
null
11,034
2
null
10,999
2
null
Definitely upgrade to TFS 2008 and Visual Studio 2008, as it is the "v2" version of Team System in every way. Fixes lots of small and medium sized problems. As for "things being randomly checked out" this is almost due to Visual Studio deciding to edit files on your behalf. Try getting latest from the Team Explorer, ...
null
CC BY-SA 2.5
null
2008-08-14T13:48:02.523
2008-08-14T13:48:02.523
null
null
1
null
11,038
2
null
11,028
1
null
I just want to say that this kind of joining is the devils work. Just think about it; the conditions for joining and filtering gets mixed together in the where statement. What happens when you need to join across 20 tables and filter on 15 values? Again, just my $.02
null
CC BY-SA 2.5
null
2008-08-14T13:50:39.430
2008-08-14T13:50:39.430
null
null
960
null
11,044
2
null
11,028
4
null
You don't need to do this in todays database engines, but there was a time when things like that would give the query optimizer more hints as to possible index paths and thus to speedier results. These days that entire syntax is going out anyway.
null
CC BY-SA 2.5
null
2008-08-14T13:53:33.963
2008-08-14T13:53:33.963
null
null
267
null
11,041
2
null
11,028
1
null
In Microsoft SQL the query plans for these two queries are identical - they are executed in the same way.
null
CC BY-SA 2.5
null
2008-08-14T13:51:24.250
2008-08-14T13:51:24.250
null
null
905
null
11,028
1
11,044
null
4
3,020
When I'm joining three or more tables together by a common column, I'd write my query like this: ``` SELECT * FROM a, b, c WHERE a.id = b.id AND b.id = c.id ``` a colleague recently asked my why I didn't do explicit in my queries like this: ``` SELECT * FROM a, b, c WHERE a.id = b.id AND b.id = c.id AN...
What are the advantages of explicit Join Transitive Closure in SQL?
CC BY-SA 2.5
0
2008-08-14T13:44:43.357
2013-11-03T09:15:43.210
2017-05-23T10:32:50.733
-1
1,030
[ "sql" ]
11,043
1
11,053
null
45
39,597
What are the pros and cons of using table aliases in SQL? I personally try to avoid them, as I think they make the code less readable (especially when reading through large where/and statements), but I'd be interested in hearing any counter-points to this. When is it generally a good idea to use table aliases, and do...
SQL Table Aliases - Good or Bad?
CC BY-SA 2.5
0
2008-08-14T13:53:33.467
2016-11-01T19:19:57.343
2016-09-12T20:47:13.650
4,370,109
637
[ "sql", "alias" ]
11,004
2
null
10,901
9
null
I'm a developer on an app that has a ton of legacy MFC code, and we have all of your same concerns. A big driver for our strategy was to eliminate as much risk and uncertainty as we could, which meant avoiding The Big Rewrite. As we all know, TBR fails most of the time. So we chose an incremental approach that allows u...
null
CC BY-SA 2.5
null
2008-08-14T13:32:29.810
2009-02-25T22:41:07.390
2009-02-25T22:41:07.390
1,042
1,042
null
11,049
2
null
11,043
30
null
Well, there are some cases you use them, like when you need to join to the same table twice in one query. It also depends on wether you have unique column names across tables. In our legacy database we have 3-letter prefixes for all columns, stemming from an abbreviated form from the table, simply because one ancient...
null
CC BY-SA 2.5
null
2008-08-14T13:55:54.100
2008-08-14T13:55:54.100
null
null
267
null
11,050
2
null
11,043
1
null
IMHO, it doesn't really matter with short table names that make sense, I have on occasion worked on databases where the table name could be something like VWRECOFLY or some other random string (dictated by company policy) that really represents users, so in that case I find aliases really help to make the code FAR more...
null
CC BY-SA 3.0
null
2008-08-14T13:56:07.517
2013-07-26T16:00:47.450
2013-07-26T16:00:47.450
96,780
673
null
11,045
1
12,018
null
79
161,134
How can I get a user-defined function to re-evaluate itself based on changed data in the spreadsheet? I tried and . The only thing that seems to work is editing the cell with the function call and then pressing Enter.
Refresh Excel VBA Function Results
CC BY-SA 4.0
0
2008-08-14T13:54:43.947
2019-09-14T00:15:08.277
2019-09-14T00:15:08.277
-1
767
[ "excel", "vba", "user-defined-functions" ]
11,042
2
null
5,222
59
null
Here's a simple example. I didn't get fancy with the html or the servlet, but you should get the idea. I hope this helps you out. ``` <html> <body> <form method="post" action="/myServlet"> <input type="text" name="username" /> <input type="password" name="password" /> <input type="submit" /> </form> </body> </html> `...
null
CC BY-SA 2.5
null
2008-08-14T13:52:55.730
2008-09-17T13:47:45.670
2008-09-17T13:47:45.670
1,310
1,310
null
11,057
2
null
11,043
3
null
You need them if you're going to join a table to itself, or if you use the column again in a subquery...
null
CC BY-SA 2.5
null
2008-08-14T13:57:54.813
2008-08-14T13:57:54.813
null
null
26
null
11,056
2
null
11,043
1
null
I like long explicit table names (it's not uncommon to be more than 100 characters) because I use many tables and if the names aren't explicit, I might get confused as to what each table stores. So when I write a query, I tend to use shorter aliases that make sense within the scope of the query and that makes the code...
null
CC BY-SA 2.5
null
2008-08-14T13:57:33.957
2008-08-14T13:57:33.957
null
null
810
null
11,048
2
null
10,926
0
null
I don't immediately see the problem, so I can only venture a guess. The `delete` line that you've got is looking for the first item of the list which has an attribute "Id" with a value equal to `idOfReplacee`. Ensure that you don't need to dig deeper into the XML structure to find that matching id. Try this instead...
null
CC BY-SA 2.5
null
2008-08-14T13:55:29.920
2008-08-14T13:55:29.920
null
null
863
null
11,055
1
11,080
null
4
440
I'm trying to figure out how big a certain database would be (it hasn't been created yet). I know how many rows and what the tables will be. Is there a feature in Oracle that will tell me the size of such a theoretical database? Is there a known math formula I can use? I know there is a feature to determine the size of...
How big would such a database be?
CC BY-SA 2.5
null
2008-08-14T13:57:20.227
2012-08-03T21:34:17.117
2012-08-03T21:34:17.117
8,454
543
[ "database", "oracle" ]
11,053
2
null
11,043
31
null
Table aliases are a necessary evil when dealing with highly normalized schemas. For example, and I'm not the architect on this DB so bear with me, it can take 7 joins in order to get a clean and complete record back which includes a person's name, address, phone number and company affiliation. Rather than the somewha...
null
CC BY-SA 2.5
null
2008-08-14T13:56:45.207
2008-08-14T14:00:37.023
2008-08-14T14:00:37.023
149
149
null
11,059
2
null
10,926
1
null
Perhaps you could use `replace` instead? ``` var oldNode : XML = this._DataPages[this._Options.PageIndex].Data.(@Id == idOfReplacee)[0]; var newNode : XML = this._WebService.GetSingleModelXml.lastResult.*[0].*[0]; oldNode.parent.replace(oldNode, newNode); ```
null
CC BY-SA 2.5
null
2008-08-14T13:58:33.923
2008-08-14T13:58:33.923
null
null
1,109
null
11,061
2
null
11,045
18
null
Okay, found this one myself. You can use ++ to accomplish this.
null
CC BY-SA 3.0
null
2008-08-14T13:59:21.643
2015-04-21T15:33:04.533
2015-04-21T15:33:04.533
3,906,965
767
null
11,064
2
null
11,043
8
null
Microsoft SQL's query optimiser benefits from using either fully qualified names or aliases. Personally I prefer aliases, and unless I have a lot of tables they tend to be single letter ones. ``` --seems pretty readable to me ;-) select a.Text from Question q inner join Answer a on a.QuestionId = q.Questi...
null
CC BY-SA 2.5
null
2008-08-14T14:00:26.570
2008-08-14T14:00:26.570
null
null
905
null
11,072
2
null
11,043
5
null
If I write a query myself (by typing into the editor and not using a designer) I always use aliases for the table name just so I only have to type the full table name once.I really hate reading queries generated by a designer with the full table name as a prefix to every column name.
null
CC BY-SA 2.5
null
2008-08-14T14:02:40.153
2008-08-14T14:02:40.153
null
null
961
null
11,060
1
11,074
null
29
7,874
This is a difficult and open-ended question I know, but I thought I'd throw it to the floor and see if anyone had any interesting suggestions. I have developed a code-generator that takes our python interface to our C++ code (generated via SWIG) and generates code needed to expose this as WebServices. When I develope...
How should I unit test a code-generator?
CC BY-SA 2.5
0
2008-08-14T13:59:21.533
2015-07-20T04:10:25.057
2008-08-23T19:52:34.193
2,134
912
[ "c++", "python", "unit-testing", "code-generation", "swig" ]
11,074
2
null
11,060
14
null
I started writing up a summary of my experience with my own code generator, then went back and re-read your question and found you had already touched upon the same issues yourself, focus on the execution results instead of the code layout/look. Problem is, this is hard to test, the generated code might not be suited ...
null
CC BY-SA 2.5
null
2008-08-14T14:04:25.800
2008-08-14T14:04:25.800
null
null
267
null
11,080
2
null
11,055
5
null
you can from the size of the data types for the columns in a table. You can then get a rough estimate of the size of a row in that table. then for 1 to n tables, then for 1 row in 1 table for x rows in x tables = estimate of the database for a given rowsize. Long handed I know but this is how i normally do this.
null
CC BY-SA 2.5
null
2008-08-14T14:07:27.307
2008-08-14T14:07:27.307
null
null
null
null
11,092
2
null
11,088
-1
null
I guess you could just use a short to store them. Not very efficient, but really the only option besides some herculean effort that I have seen.
null
CC BY-SA 2.5
null
2008-08-14T14:17:48.847
2008-08-14T14:17:48.847
null
null
17
null
11,085
1
64,160
null
20
12,480
In Perl, an object is just a reference to any of the basic Perl data types that has been blessed into a particular class. When you use the ref() function on an unblessed reference, you are told what data type the reference points to. However, when you call ref() on a blessed reference, you are returned the name of th...
How can I determine the type of a blessed reference in Perl?
CC BY-SA 2.5
0
2008-08-14T14:11:42.913
2018-11-01T13:56:01.457
2008-11-28T18:31:52.837
2,766,176
166
[ "perl", "reference", "types" ]
11,088
1
11,101
null
59
26,848
In Java, there is no such thing as an unsigned byte. Working with some low level code, occasionally you need to work with bytes that have unsigned values greater than 128, which causes Java to interpret them as a negative number due to the MSB being used for sign. What's a good way to work around this? (Saying don't ...
What is the best way to work around the fact that ALL Java bytes are signed?
CC BY-SA 2.5
0
2008-08-14T14:14:03.940
2018-08-01T16:00:06.617
null
null
1,309
[ "java", "byte", "unsigned", "signed" ]
11,069
2
null
10,949
2
null
You method of testing will depend on the type of solution you come up with. If you write some custom cloning code and have to manually implement that in each cloneable type then you should really test the cloning of each one of those types. Alternatively, if you decide to go a more generic route (where the aforementi...
null
CC BY-SA 2.5
null
2008-08-14T14:01:59.097
2008-08-14T14:01:59.097
null
null
1,314
null
11,105
2
null
11,099
0
null
Our boss makes us put { } after a decision statement no matter what, even if it's a single statement. It's really annoying to add two extra lines. The only exception is ternary operators. I guess it's a good thing I have my code monitor in portrait orientation at 1200x1600.
null
CC BY-SA 2.5
null
2008-08-14T14:27:03.383
2008-08-14T14:27:03.383
null
null
448
null
11,098
2
null
11,088
0
null
Probably your best bet is to use an integer rather than a byte. It has the room to allow for numbers greater than 128 without the overhead of having to create a special object to replace byte. This is also suggested by people smarter than me (everybody) - [http://www.darksleep.com/player/JavaAndUnsignedTypes.html]...
null
CC BY-SA 2.5
null
2008-08-14T14:22:24.997
2008-08-14T14:22:24.997
null
null
361
null
11,091
2
null
3,150
4
null
The framework included with VS9 .NET, but you can write tests in C++/CLI, so as long as you're comfortable learning some .NET isms, you should be able to test most any C++ code. [boost.test](http://www.boost.org/doc/libs/1_35_0/libs/test/doc/) and [googletest](http://code.google.com/p/googletest/) look to be fairly ...
null
CC BY-SA 2.5
null
2008-08-14T14:17:39.610
2008-08-14T14:17:39.610
null
null
1,319
null
11,102
2
null
11,099
2
null
It doesn't really matter, as long as you're consistent with it. There does seem to be a tendency to demand sameness within a single statement, i.e. if there's brackets in one branch, there's brackets everywhere. The Linux kernel coding standards, for one, mandate that.
null
CC BY-SA 2.5
null
2008-08-14T14:25:17.443
2008-08-14T14:25:17.443
null
null
414
null
11,107
2
null
11,099
10
null
There isn't really a right answer. This is what coding standards within the company are for. If you can keep it consistent across the whole company then it will be easy to read. I personally like ``` if ( a == b) { doSomething(); } else { doSomething(); } ``` but this is a holy war.
null
CC BY-SA 2.5
null
2008-08-14T14:27:26.750
2008-08-14T14:27:26.750
null
null
361
null
11,110
2
null
11,099
1
null
I've always used brackets at all times except for the case where I'm checking a variable for NULL before freeing it, like is necessary in C In that case, I make sure it's clear that it's a single statement by keeping everything on one line, like this: ``` if (aString) free(aString); ```
null
CC BY-SA 2.5
null
2008-08-14T14:28:36.903
2008-08-14T14:28:36.903
null
null
75
null
11,101
2
null
11,088
20
null
When reading any single value from the array copy it into something like a short or an int and manually convert the negative number into the positive value it should be. ``` byte[] foobar = ..; int value = foobar[10]; if (value < 0) value += 256 // Patch up the 'falsely' negative value ``` You can do a similar conve...
null
CC BY-SA 2.5
null
2008-08-14T14:24:50.453
2008-08-14T14:24:50.453
null
null
755
null
11,112
1
2,028,892
null
7
1,173
Most wiki software I've presents lots of "features" on their pages. This is fine for desktop users, but is annoying when using an iPhone or other mobile device. I'd prefer pages that just had the content, along with maybe an Edit button and a Search button. The editors are also often too fancy for mobile users; a si...
Best Wiki for Mobile Users
CC BY-SA 3.0
0
2008-08-14T14:30:17.277
2017-10-04T10:00:00.523
2015-04-17T10:27:26.090
155,077
1,175
[ "iphone", "wiki", "mobile-website" ]
11,111
2
null
10,324
2
null
For larger Hex strings like in the example I needed to use [strtoul](http://www.cplusplus.com/reference/clibrary/cstdlib/strtoul.html).
null
CC BY-SA 2.5
null
2008-08-14T14:29:34.500
2008-08-14T14:29:34.500
null
null
null
null
11,114
2
null
11,028
4
null
This is filthy, evil legacy syntax. You write this as > ``` Select * -- Oh, and don't ever use *, either From A Inner Join B On A.ID = B.ID Inner Join C On B.ID = C.ID ```
null
CC BY-SA 2.5
null
2008-08-14T14:30:39.007
2008-08-14T14:30:39.007
null
null
414
null
11,099
1
11,107
null
3
923
In the case of languages that support single decision and action without brackets, such as the following example: ``` if (var == true) doSomething(); ``` What is the preferred way of writing this? Should brackets always be used, or should their usage be left as a preference of the individual developer? Additiona...
What is the prefered style for single decision and action statements?
CC BY-SA 2.5
null
2008-08-14T14:23:11.237
2018-02-08T21:11:20.433
2018-02-08T21:11:20.433
3,745,896
1,185
[ "language-agnostic", "language-features", "readability" ]