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
36,738
2
null
36,106
0
null
Straight forward lossless compression is the way to go. To make it searchable you will have to compress relatively small blocks and create an index into an array of the blocks. This index can contain the bit offset of the starting bit in each block.
null
CC BY-SA 2.5
null
2008-08-31T09:58:23.073
2008-08-31T09:58:23.073
null
null
3,685
null
36,729
2
null
36,707
229
null
I would say it would be incredibly unwise to decide arbitrarily against multiple exit points as I have found the technique to be useful in practice , in fact I have often to multiple exit points for clarity. We can compare the two approaches thus:- ``` string fooBar(string s, int? i) { string ret = ""; if(!string...
null
CC BY-SA 3.0
null
2008-08-31T09:46:19.903
2014-06-06T14:30:57.977
2014-06-06T14:30:57.977
648,658
3,394
null
36,735
2
null
36,733
1
null
I personally would store the required redirection info in an object and handle globally. I would avoid using a QueryString param or the like since they could try bouncing themselves back to a page they are not supposed to (possible security issue?). You could then create a static method to handle the redirection object...
null
CC BY-SA 3.0
null
2008-08-31T09:52:45.787
2013-05-27T16:56:33.863
2013-05-27T16:56:33.863
1,012,641
832
null
36,739
2
null
7,651
71
null
Install [List::MoreUtils](http://search.cpan.org/dist/List-MoreUtils/) from CPAN Then in your code: ``` use strict; use warnings; use List::MoreUtils qw(uniq); my @dup_list = qw(1 1 1 2 3 4 4); my @uniq_list = uniq(@dup_list); ```
null
CC BY-SA 3.0
null
2008-08-31T10:01:18.683
2016-05-15T14:32:32.617
2016-05-15T14:32:32.617
3,824,339
3,838
null
36,740
2
null
2,871
7
null
Watch out for packing issues. In the example you gave all fields are at the obvious offsets because everything is on 4 byte boundaries but this will not always be the case. Visual C++ packs on 8 byte boundaries by default.
null
CC BY-SA 2.5
null
2008-08-31T10:03:39.317
2009-12-03T09:34:03.727
2009-12-03T09:34:03.727
3,685
3,685
null
36,747
2
null
36,701
1
null
This is a question on Object Oriented Design, not Java the language. It's generally good practice to hide data types within the class and expose only the methods that are part of the class API. If you expose internal data types, you can never change them in the future. If you hide them, your only obligation to the user...
null
CC BY-SA 2.5
null
2008-08-31T10:13:01.230
2008-08-31T10:13:01.230
null
null
1,772
null
36,744
2
null
20,298
34
null
When using storyboards to control an animation, make sure you set the second parameter to true in order to set the animation as controllable: ``` public void Begin( FrameworkContentElement containingObject, **bool isControllable** ) ```
null
CC BY-SA 3.0
null
2008-08-31T10:08:30.913
2014-01-12T20:56:20.227
2014-01-12T20:56:20.227
1,470,327
3,837
null
36,748
1
null
null
13
19,812
What's the best way to asynchronously load an BitmapImage in C# using WPF?
Asynchronously Loading a BitmapImage in C# using WPF
CC BY-SA 4.0
0
2008-08-31T10:13:24.427
2019-03-11T18:52:31.380
2019-03-11T18:52:31.380
285,795
3,837
[ "c#", "wpf" ]
36,749
2
null
33,664
19
null
Have you looked at [SqlMetal](http://msdn.microsoft.com/en-us/library/bb386987.aspx)? It's officially supported, although not promoted too much. You can use it to build dbmls from the commandline - we've used it as part of a db's continous integration updates (make sure you have really good code separation if you do th...
null
CC BY-SA 2.5
null
2008-08-31T10:21:21.397
2008-08-31T10:21:21.397
null
null
1,521
null
36,741
2
null
36,108
175
null
Each control deriving from `Panel` implements distinct layout logic performed in `Measure()` and `Arrange()`: - `Measure()`- `Arrange()` The last child of the `DockPanel` fills the remaining space. You can disable this behavior by setting the `LastChild` property to `false`. The `StackPanel` asks each child for its...
null
CC BY-SA 4.0
null
2008-08-31T10:04:15.150
2018-09-17T12:41:12.813
2018-09-17T12:41:12.813
1,951,524
3,837
null
36,743
2
null
35,372
4
null
I can't access your site at the moment, so I'm basing this on fairly limited information. But if the home page is static content, the views module might not be appropriate. It might be better to create a page (In the menu, go to: Create content > page), make a note of the page's url, and then change the default home pa...
null
CC BY-SA 2.5
null
2008-08-31T10:07:33.643
2008-08-31T10:07:33.643
null
null
2,434
null
36,750
2
null
36,108
6
null
Use the and layout properties. They control how an element uses the space it has inside its parent when more room is available than it required by the element. The width of a StackPanel, for example, will be as wide as the widest element it contains. So, all narrower elements have a bit of excess space. The alignmen...
null
CC BY-SA 2.5
null
2008-08-31T10:24:05.820
2008-08-31T10:24:05.820
null
null
373
null
36,752
2
null
36,707
19
null
In general I try to have only a single exit point from a function. There are times, however, that doing so actually ends up creating a more complex function body than is necessary, in which case it's better to have multiple exit points. It really has to be a "judgement call" based on the resulting complexity, but the g...
null
CC BY-SA 3.0
null
2008-08-31T10:29:18.070
2016-01-08T19:37:01.350
2016-01-08T19:37:01.350
1,559
1,559
null
36,753
2
null
36,706
0
null
If you have half decent 3D acceleration on board, CompizFusion adds attractive desktop effects like mapping your workspaces onto a cube using that to switch between them/move windows between them. Looks pretty and improves general usability - great! [http://en.wikipedia.org/wiki/Compiz](http://en.wikipedia.org/wiki/Co...
null
CC BY-SA 2.5
null
2008-08-31T10:31:13.807
2008-08-31T10:31:13.807
null
null
2,362
null
36,757
2
null
36,748
3
null
Assuming you're using data binding, setting [Binding.IsAsync](http://msdn.microsoft.com/en-us/library/system.windows.data.binding.isasync.aspx) property to True seems to be a standard way to achieve this. If you're loading the bitmap in the code-behind file using background thread + Dispatcher object is a common way to...
null
CC BY-SA 2.5
null
2008-08-31T10:34:46.857
2008-08-31T10:34:46.857
null
null
1,196
null
36,751
2
null
12,368
1
null
@Keith, I agree with all of your rules except #4. Adding a finalizer should only be done under very specific circumstances. If a class uses unmanaged resources, those should be cleaned up in your Dispose(bool) function. This same function should only cleanup managed resources when bool is true. Adding a finalizer adds...
null
CC BY-SA 2.5
null
2008-08-31T10:26:30.247
2008-08-31T10:26:30.247
null
null
1,559
null
36,761
2
null
35,922
1
null
I use pyGtk. I think wxPython is nice but it's too limited, and PyQt is, well, Qt. =)
null
CC BY-SA 2.5
null
2008-08-31T10:41:13.767
2008-08-31T10:41:13.767
null
null
2,119
null
36,742
1
null
null
4
1,630
My GPS logger occassionally leaves "unfinished" lines at the end of the log files. I think they're only at the end, but I want to check all lines just in case. A sample complete sentence looks like: ``` $GPRMC,005727.000,A,3751.9418,S,14502.2569,E,0.00,339.17,210808,,,A*76 ``` The line should start with a `$` sig...
How do I find broken NMEA log sentences with grep?
CC BY-SA 2.5
0
2008-08-31T10:04:35.900
2009-10-07T22:20:39.077
2009-10-07T22:20:39.077
147,141
3,715
[ "regex", "grep", "gps", "nmea" ]
36,763
2
null
36,760
1
null
You want a left join, instead of an inner join, as that allows records to not exist.
null
CC BY-SA 2.5
null
2008-08-31T10:41:26.933
2008-08-31T10:41:26.933
null
null
489
null
36,764
2
null
36,760
1
null
LEFT join is your friend. To learn more about different join types refer to [http://en.wikipedia.org/wiki/Join_(SQL)](http://en.wikipedia.org/wiki/Join_(SQL))
null
CC BY-SA 2.5
null
2008-08-31T10:42:11.970
2008-08-31T10:42:11.970
null
null
1,196
null
36,762
2
null
36,760
31
null
Change your "inner join" to a "left outer join", which means "get me all the rows on the left of the join, even if there isn't a matching row on the right." ``` select page.name, count(page-attachment.id) as attachmentsnumber from page left outer join page-attachment on page.id=page-id group by page.name ```
null
CC BY-SA 2.5
null
2008-08-31T10:41:16.793
2009-01-21T19:54:02.890
2009-01-21T19:54:02.890
615
615
null
36,766
2
null
4,689
2
null
I second Consolas, Inconsolata, DejaVu Sans Mono, and Droid Sans Mono, with my preference going towards the Droid one.
null
CC BY-SA 2.5
null
2008-08-31T10:47:37.510
2008-08-31T10:47:37.510
null
null
2,018
null
36,765
2
null
4,689
1
null
Another vote up for [Dina](http://www.donationcoder.com/Software/Jibz/Dina/). As long as you use it at its optimum size (9 pt), it looks great. ![alt text](https://www.donationcoder.com/Software/Jibz/Dina/dina_c.png)
null
CC BY-SA 2.5
null
2008-08-31T10:44:35.443
2008-08-31T10:44:35.443
2017-02-08T14:07:42.527
-1
1,261
null
36,771
2
null
35,191
1
null
Sounds like a bug. If you can replicate this, I recommend you contact Microsoft Support or use the Microsoft Connect bug reporting web site. I did not find any mention of this in a preliminary search.
null
CC BY-SA 2.5
null
2008-08-31T11:10:29.563
2008-08-31T11:10:29.563
null
null
2,928
null
36,760
1
36,762
null
14
33,476
I have three tables: page, attachment, page-attachment I have data like this: ``` page ID NAME 1 first page 2 second page 3 third page 4 fourth page attachment ID NAME 1 foo.word 2 test.xsl 3 mm.ppt page-attachment ID PAGE-ID ATTACHMENT-ID 1 2 1 2 2 2 3...
SQL Query, Count with 0 count
CC BY-SA 3.0
0
2008-08-31T10:39:58.230
2015-03-21T19:02:28.637
2015-03-21T19:02:28.637
3,041,194
2,138
[ "sql", "count" ]
36,737
2
null
12,368
19
null
The responses to this question have got more than a little confused. The title asks about disposal, but then says that they want memory back immediately. .Net is , which means that when you write .Net apps you don't need to worry about memory directly, the cost is that you don't have direct control over memory either...
null
CC BY-SA 2.5
null
2008-08-31T09:56:24.013
2008-09-01T09:09:20.920
2008-09-01T09:09:20.920
905
905
null
36,775
2
null
36,106
0
null
Quick combinatoric proof that you can't really save much space: Suppose you have an arbitrary subset of n/2 bits set to 1 out of n total bits. You have (n choose n/2) possibilities. Using [Stirling's formula](http://en.wikipedia.org/wiki/Stirling%27s_formula), this is roughly 2^n / sqrt(n) * sqrt(2/pi). If every po...
null
CC BY-SA 2.5
null
2008-08-31T11:16:13.463
2008-08-31T11:16:13.463
null
null
3,561
null
36,767
2
null
6,009
6
null
+1 on the template approach. But since this question has tag Git, the distributed alternative springs to mind, in which customizations are kept on a private testing branch: ``` A---B---C---D--- <- mainline (public) \ \ B'------D'--- <- testing (private) ``` In this scheme, the main...
null
CC BY-SA 2.5
null
2008-08-31T11:01:56.727
2008-08-31T11:01:56.727
null
null
3,844
null
36,651
2
null
36,647
3
null
There's [testoob](http://testoob.sourceforge.net/) which is pretty complete suite of test.Also xUnit-ie, and has a nice reporting option
null
CC BY-SA 2.5
null
2008-08-31T05:20:32.587
2008-08-31T05:20:32.587
null
null
3,117
null
36,776
2
null
35,785
0
null
Usually I use [jaxb](http://jaxb.java.net/) or [XMLBeans](http://xmlbeans.apache.org/) if I need to create objects serializable to XML. Now, I can see that [XStream](http://xstream.codehaus.org/) might be very useful as it's nonintrusive and has really simple api. I'll play with it soon and probably use it. The only dr...
null
CC BY-SA 2.5
null
2008-08-31T11:19:06.657
2008-08-31T11:19:06.657
null
null
3,666
null
36,778
1
36,914
null
6
3,771
After hours of debugging, it appears to me that in FireFox, the innerHTML of a DOM reflects what is actually in the markup, but in IE, the innerHTML reflects what's in the markup PLUS any changes made by the user or dynamically (i.e. via Javascript). Has anyone else found this to be true? Any interesting work-arounds ...
Firefox vs. IE: innerHTML handling
CC BY-SA 2.5
null
2008-08-31T11:23:46.147
2008-09-17T08:09:05.767
null
null
1,693
[ "javascript", "internet-explorer", "firefox", "dom" ]
36,718
2
null
36,701
4
null
If the Java way is the OO way, then yes, creating a class with public fields breaks the principles around information hiding which say that an object should manage its own internal state. (So as I'm not just spouting jargon at you, a benefit of information hiding is that the internal workings of a class are hidden behi...
null
CC BY-SA 2.5
null
2008-08-31T09:33:52.383
2008-08-31T09:39:58.047
2008-08-31T09:39:58.047
2,362
2,362
null
36,780
2
null
308
9
null
Have your initial create table statements in version controller, then add alter table statements, but never edit files, just more alter files ideally named sequentially, or even as a "change set", so you can find all the changes for a particular deployment. The hardiest part that I can see, is tracking dependencies, ...
null
CC BY-SA 2.5
null
2008-08-31T11:25:21.103
2008-08-31T11:25:21.103
null
null
3,839
null
36,788
2
null
2,767
7
null
+1 for Visual Assist And I will add [VLH](http://www.codeplex.com/VLH2005) (Visual Local History) which provides a kind of local source control system. Every time you save a file, the plugin add a copy in the local repository.
null
CC BY-SA 2.5
null
2008-08-31T11:38:13.020
2008-08-31T12:43:51.537
2008-08-31T12:43:51.537
1,578
1,578
null
36,792
2
null
27,779
3
null
There's lots of useful information here: [http://www.flounder.com/mvp_tips.htm](http://www.flounder.com/mvp_tips.htm)
null
CC BY-SA 2.5
null
2008-08-31T11:41:13.280
2008-08-31T11:41:13.280
null
null
3,853
null
36,793
2
null
36,778
11
null
I use jQuery's [.html()](http://docs.jquery.com/Attributes/html) to get a consistent result across browsers.
null
CC BY-SA 2.5
null
2008-08-31T11:41:34.153
2008-08-31T11:41:34.153
null
null
238
null
36,791
2
null
8,517
3
null
dlamblin,let me see if I get this correctly: You want to make a prefix-based query, and then sort the results by population, and maybe combine the sort order with preference for exact matches. I suggest you separate the search from the sort and use a CustomSorter for the sorting: Here's [a blog entry describing a custo...
null
CC BY-SA 2.5
null
2008-08-31T11:40:56.760
2008-08-31T11:40:56.760
null
null
1,702
null
36,796
2
null
31,598
1
null
Have you considered using a UI functional testing tool? You could check out [HP's QuickTest Professional](https://h10078.www1.hp.com/cda/hpms/display/main/hpms_content.jsp?zn=bto&cp=1-11-127-24%5E1352_4000_100__) which covers a wide varieties of UI technologies.
null
CC BY-SA 2.5
null
2008-08-31T11:45:27.870
2008-08-31T11:45:27.870
null
null
3,848
null
36,795
2
null
7,885
5
null
Currently I use [Object::InsideOut](http://search.cpan.org/dist/Object-InsideOut/) whenever I want objects, its quite nice and will give you a lot of features over standard blessed hash objects. Having said that, if I was starting a new project I would seriously look at Moose. While it is good to read the official PER...
null
CC BY-SA 2.5
null
2008-08-31T11:45:00.960
2008-08-31T11:45:00.960
null
null
3,839
null
36,797
2
null
36,733
1
null
I agree with "rmbarnes.myopenid.com" regarding this issue as being platform independent. I would store the calling page URL in the QueryString or in a hidden field (for example in ViewState for ASP.NET). If you will store it outside of the page scope (such as Session, global variable - Application State and so on) th...
null
CC BY-SA 2.5
null
2008-08-31T11:47:15.933
2008-08-31T11:47:15.933
null
null
1,796
null
36,781
2
null
36,733
1
null
This message my be tagged asp.net but I think it is a platform independent issue that pains all new web developers as they seek a 'clean' way to do this. I think the two options in achieving this are: 1. A param in the url 2. A url stored in the session I don't like the url method, it is a bit messy, and you have...
null
CC BY-SA 2.5
null
2008-08-31T11:26:10.243
2008-08-31T11:26:10.243
null
null
1,349,865
null
36,800
2
null
36,647
3
null
Consider [py.test](http://codespeak.net/py/dist/test.html). Not exactly analogous to NUnit, but very good, with nice features including test auto-discovery and a "Watch the tests and code - when something changes rerun the tests that failed last time. As soon as all the tests pass, switch to running all the tests whene...
null
CC BY-SA 2.5
null
2008-08-31T11:53:28.303
2008-08-31T11:53:28.303
null
null
1,199
null
36,803
2
null
36,600
0
null
The build-in remote desktop works. (You don't have to do anything special) But it is extremely slow, because when in doubt, it just sends the contents of a window as a bitmap.
null
CC BY-SA 2.5
null
2008-08-31T11:55:34.697
2008-08-31T11:55:34.697
null
null
3,186
null
36,802
2
null
35,870
1
null
Based on your clarifications, I would use a geometrical data structure such as a KD-tree or an R-tree. MySQL has a SPATIAL data type which does this. Other languages/frameworks/databases have libraries to support this. Basically, such a data structure embeds the points in a tree of rectangles, and searches the tree usi...
null
CC BY-SA 2.5
null
2008-08-31T11:54:37.430
2008-08-31T11:54:37.430
null
null
1,702
null
36,805
2
null
36,502
0
null
Windows does not cache recently used DLLs in memory. It does cache the contents of the files in the file cache, like it would normally do with data files.
null
CC BY-SA 2.5
null
2008-08-31T11:58:11.350
2008-08-31T11:58:11.350
null
null
3,186
null
36,809
2
null
34,365
0
null
Ditto Espo's answer and I would like to add that usually in medium trust (specific to many shared hostings) you will not have access to reflection so ... RewritePath will remain your probably only choice.
null
CC BY-SA 2.5
null
2008-08-31T12:05:19.867
2008-08-31T12:05:19.867
null
null
1,796
null
36,799
2
null
36,642
1
null
What you are referring to is [AJAX URL history management](http://quickstarts.asp.net/Futures/ajax/doc/history.aspx) but you will not be able to modify the URL besides the "#" anchor. At least not without reloading the page.
null
CC BY-SA 3.0
null
2008-08-31T11:49:47.033
2016-12-20T05:27:16.143
2016-12-20T05:27:16.143
1,380,867
1,796
null
36,812
1
36,935
null
7
4,173
Currently, I am writing up a bit of a product-based CMS as my first project. Here is my question. How can I add additional data (products) to my Product model? I have added '/admin/products/add' to my urls.py, but I don't really know where to go from there. How would i build both my view and my template? Please keep ...
How do I add data to an existing model in Django?
CC BY-SA 2.5
null
2008-08-31T12:11:10.320
2013-07-12T20:05:34.487
2009-01-12T15:47:39.423
3,609
2,592
[ "python", "django" ]
36,813
1
36,927
null
3
8,863
When and how should table stats gathering be performed for Oracle, version 9 and up? How would you go about gathering stats for a large database, where stats gathering would collide with "business hours".
Table Stats gathering for Oracle
CC BY-SA 2.5
null
2008-08-31T12:11:42.690
2015-12-18T06:33:53.793
2015-12-18T06:33:53.793
3,989,608
3,839
[ "oracle", "table-statistics" ]
36,814
2
null
27,695
0
null
> I there f I choose to never commit the file, I always have a "dirty" checkout - I am unhappy. With regard to this particular point, you might want to `.gitignore` the file as other have suggested, or to use a scheme like the one described in [this answer](https://stackoverflow.com/questions/6009/how-do-you-deal-with...
null
CC BY-SA 2.5
null
2008-08-31T12:11:48.510
2008-08-31T12:11:48.510
2017-05-23T12:02:38.290
-1
3,844
null
36,816
2
null
25,458
12
null
My most pertinent experience was writing code to compare any two data entities of the same type in a large object model property-wise. Got it working, tried it, ran like a dog, obviously. I was despondent, then overnight realised that wihout changing the logic, I could use the same algorithm to auto-generate method...
null
CC BY-SA 2.5
null
2008-08-31T12:18:42.393
2008-08-31T12:18:42.393
null
null
3,856
null
36,818
2
null
36,812
-2
null
Follow the Django tutorial for setting up the "admin" part of an application. This will allow you to modify your database. [Django Admin Setup](https://docs.djangoproject.com/en/dev/intro/tutorial02/) Alternatively, you can just connect directly to the database using the standard tools for whatever database type you ...
null
CC BY-SA 3.0
null
2008-08-31T12:19:14.780
2013-07-12T20:02:20.103
2013-07-12T20:02:20.103
1,011,749
3,839
null
36,827
2
null
36,812
-1
null
This topic is covered in [Django tutorials](https://code.djangoproject.com/wiki/Tutorials).
null
CC BY-SA 3.0
null
2008-08-31T12:31:49.790
2013-07-12T20:05:34.487
2013-07-12T20:05:34.487
1,011,749
3,448
null
36,825
1
37,071
null
0
843
Is there any way to listen to an Oracle AQ using a Perl process as the listener.
Integrating Perl and Oracle Advanced Queuing
CC BY-SA 2.5
null
2008-08-31T12:29:38.700
2008-10-17T17:57:37.277
2008-10-17T17:57:37.290
null
3,839
[ "perl", "oracle", "messaging", "advanced-queuing" ]
36,806
1
37,009
null
12
12,301
I have been sold on mod_wsgi and apache rather than mod_python. I have all the parts installed (django, apache, mod_wsgi) but have run into a problem deploying. I am on osx 10.5 with apache 2.2 and django 1.0b2, mod_wsgi-2.3 My application is called tred. Here are the relevant files: httpd-vhosts (included in httpd-...
Setup django with WSGI and apache
CC BY-SA 2.5
0
2008-08-31T12:03:20.513
2013-07-22T20:14:55.997
null
null
3,431,280
[ "python", "django", "apache", "mod-wsgi" ]
36,830
2
null
36,296
0
null
I'd say that anyone that finds the answer should keep it to themselves, and instead of posting it should just add a note that you can go read a particular url to find it, or send someone an email or something if they want to know the answer to it. At the time when Channel9 says its broken or posts the answer themselves...
null
CC BY-SA 2.5
null
2008-08-31T12:35:12.447
2008-08-31T12:35:12.447
null
null
267
null
36,821
2
null
36,515
3
null
I would use HTML like the following: ``` <div id="wrapper"> <div id="map" style="width:400px;height:400px;"></div> <div id="legend"> ... marker descriptions in here ... </div> </div> ``` You can then style this to keep the legend in the bottom right: ``` div#wrapper { position: relative; } div#legend { positi...
null
CC BY-SA 2.5
null
2008-08-31T12:25:02.083
2008-08-31T12:25:02.083
null
null
3,715
null
36,829
2
null
35,530
5
null
filter lets -frequency (detailed/local information) . filter lets -frequency (coarse/rough/global information) .
null
CC BY-SA 2.5
null
2008-08-31T12:33:28.380
2008-08-31T12:38:34.797
2008-08-31T12:38:34.797
3,388
3,388
null
36,836
2
null
36,709
5
null
[Antlr](http://antlr.org/) supports C# code generation, though it is LL(k) not technically LALR. Its tree rewriting rules are an interesting feature though.
null
CC BY-SA 2.5
null
2008-08-31T12:44:52.363
2008-08-31T12:44:52.363
null
null
3,631
null
36,831
1
36,841
null
7
24,003
I'm writing C# code that uses the windows IP Helper API. One of the functions I'm trying to call is "[GetBestInterface](http://msdn.microsoft.com/en-us/library/aa365920(VS.85).aspx)" that takes a 'uint' representation of an IP. What I need is to parse a textual representation of the IP to create the 'uint' representati...
How do you parse an IP address string to a uint value in C#?
CC BY-SA 3.0
0
2008-08-31T12:35:30.310
2019-09-18T21:33:25.350
2016-06-28T14:56:29.737
69,809
1,596
[ "c#", ".net", "winapi", "networking", "iphelper" ]
36,835
2
null
36,647
0
null
Never used xUnit, so I can't tell you if the frameworks are good/bad comparativly, but [here](http://github.com/dbr/tvdb_api/tree/master/tvdb_api.py#L518-575) is a script I wrote which uses the unittest framework (to check the API works as it should), and the doctest (to check the examples I've given work) My only pro...
null
CC BY-SA 2.5
null
2008-08-31T12:44:46.247
2008-08-31T12:44:46.247
null
null
745
null
36,837
2
null
36,832
7
null
Both ways can lead to unexpected results. Your best bet is to not call a virtual function in your constructor at all. The C++ way I think makes more sense, but leads to expectation problems when someone reviews your code. If you are aware of this situation, you should purposely not put your code in this situation f...
null
CC BY-SA 2.5
null
2008-08-31T12:47:34.727
2008-08-31T13:05:13.530
2008-08-31T13:05:13.530
3,153
3,153
null
36,833
2
null
14,923
10
null
Zack, if I understand right you want unlimited depth of the subcategories. No biggie, since MVC Preview 3 (I think 3 or 4) this has been solved. Just define a route like "{controller}/{action}/{*categoryPath}" for an url such as : [http://example.com/shop/products/household/kitchen/cookware/cooksets/nonstick](http:...
null
CC BY-SA 2.5
null
2008-08-31T12:38:24.453
2008-08-31T12:38:24.453
null
null
1,796
null
36,840
2
null
371
8
null
I would add : Provide real unsubscription upon click on "Unsubscribe". I've seen real newsletters providing a dummy unsubscription link that upon click shows " has been unsubscribed successfully" but I will still receive further newsletters.
null
CC BY-SA 2.5
null
2008-08-31T12:50:48.400
2008-08-31T12:50:48.400
null
null
1,796
null
36,779
2
null
36,742
3
null
The minimum of testing shows that this should do it: ``` grep -Ev "^\$.*\*[0-9A-Fa-f]{2}$" a.txt | grep -v ADVER ``` - - - - - - - - - `grep -v ADVER` HTH, Motti.
null
CC BY-SA 2.5
null
2008-08-31T11:24:27.220
2008-09-18T08:34:33.137
2008-09-18T08:34:33.137
3,848
3,848
null
36,842
2
null
36,742
1
null
@Motti's answer doesn't ignore ADVER lines, but you easily pipe the results of that grep to another: ``` grep -Ev "^\$.*\*[0-9A-Fa-f]{2}$" a.txt |grep -v ADVER ```
null
CC BY-SA 2.5
null
2008-08-31T12:56:11.570
2008-08-31T12:56:11.570
null
null
3,333
null
36,843
2
null
36,831
0
null
I have never found a clean solution (i.e.: a class / method in the .NET Framework) for this problem. I guess it just isn't available except the solutions / examples you provided or Aku's example. :(
null
CC BY-SA 2.5
null
2008-08-31T12:56:19.277
2008-08-31T12:56:19.277
null
null
1,796
null
36,844
2
null
36,832
1
null
I think C++ offers the best semantics in terms of having the 'most correct' behavior ... however it is more work for the compiler and the code is definitiely non-intuitive to someone reading it later. With the .NET approach the function must be very limited not to rely on any derived object state.
null
CC BY-SA 2.5
null
2008-08-31T12:56:28.340
2008-08-31T12:56:28.340
null
null
3,631
null
36,845
2
null
36,831
1
null
Byte arithmetic is discouraged, as it relies on all IPs being 4-octet ones.
null
CC BY-SA 2.5
null
2008-08-31T12:59:35.993
2008-08-31T12:59:35.993
null
null
3,583
null
36,839
2
null
36,707
191
null
I currently am working on a codebase where two of the people working on it blindly subscribe to the "single point of exit" theory and I can tell you that from experience, it's a horrible horrible practice. It makes code extremely difficult to maintain and I'll show you why. With the "single point of exit" theory, you...
null
CC BY-SA 2.5
null
2008-08-31T12:50:37.403
2008-08-31T12:50:37.403
null
null
2,284
null
36,847
2
null
36,294
5
null
@kronoz - well thanks a lot for your long answer, that's a really good place to start from. I'll follow your advices, and look for the book @vecstasy mentioned. now, let me go coding :-) ``` let thanksalot = "thanks a lot" printfn "%s" (thanksalot);; ```
null
CC BY-SA 2.5
null
2008-08-31T13:00:26.147
2008-08-31T13:00:26.147
null
null
1,178
null
36,841
2
null
36,831
13
null
MSDN [says](http://msdn.microsoft.com/en-us/library/system.net.ipaddress.getaddressbytes.aspx) that IPAddress.Address property (which returns numeric representation of IP address) is obsolete and you should use [GetAddressBytes](http://msdn.microsoft.com/en-us/library/system.net.ipaddress.getaddressbytes.aspx) method. ...
null
CC BY-SA 2.5
null
2008-08-31T12:55:45.380
2008-08-31T22:30:23.530
2008-08-31T22:30:23.530
1,196
1,196
null
36,857
2
null
36,707
7
null
Multiple exit points are fine for small enough functions -- that is, a function that can be viewed on one screen length on its entirety. If a lengthy function likewise includes multiple exit points, it's a sign that the function can be chopped up further. That said I avoid multiple-exit functions . I have felt pain of...
null
CC BY-SA 2.5
null
2008-08-31T13:38:46.600
2008-08-31T13:38:46.600
null
null
372
null
36,856
2
null
36,706
0
null
I've used by Ubuntu desktop for some coding sessions. I haven't settled on an IDE, but if I'm not using gedit, I'll use emacs as my editor. Sometimes I need to ssh to a remote server and edit from there, in which case emacs is preferred. I'm just not the vi(m) type. Maybe I'll try out Eclipse one day... I love Com...
null
CC BY-SA 2.5
null
2008-08-31T13:33:27.863
2008-08-31T13:33:27.863
null
null
3,347
null
36,858
2
null
29,761
2
null
As horrible as it looks, the `git gui` and `gitk` commands are as good as any. GitX looks extremely promising, and very Mac-like (things like QuickLook'ing any file in any revision). Gitnub is probably the furthest along in development, but it has no concept of branching currently, and is pretty basic (it does far les...
null
CC BY-SA 2.5
null
2008-08-31T13:42:14.317
2008-08-31T13:42:14.317
null
null
745
null
36,859
2
null
35,743
3
null
You can't upload file(s) via `AJAX` only by reloading a whole `HTML` document. You should either use `iframe`s if you prefer pure HTML (this is more common, eg. used by WordPress) or something else like swfupload suggested by Sven.
null
CC BY-SA 2.5
null
2008-08-31T13:49:08.760
2008-08-31T13:49:08.760
null
null
3,063
null
36,866
2
null
36,861
4
null
Well, having never used Boo, my (educated) guess is that it's for passing parameter to the closure lambda-style functions. In this case, { p | C } refers to an anonymous function taking a single parameter bound to p within the code C.
null
CC BY-SA 2.5
null
2008-08-31T14:04:20.660
2008-08-31T14:04:20.660
null
null
1,200
null
36,852
2
null
28,668
4
null
You'll need the FileMaker Pro installation CD to get the drivers. [This document](http://www.filemaker.com/downloads/pdf/fm9_odbc_jdbc_guide_en.pdf) details the process for FMP 9 - it is similar for versions 7.x and 8.x as well. Versions 6.x and earlier are completely different and I wouldn't bother trying (xDBC suppor...
null
CC BY-SA 2.5
null
2008-08-31T13:11:03.517
2008-08-31T13:11:03.517
null
null
3,861
null
36,861
1
36,869
null
3
1,116
I've run into a strange syntax in [Boo Language Guide](http://boo.codehaus.org/Closures) : ``` setter = { value | a = value } ``` What does the | operator mean?
Strange boo language syntax
CC BY-SA 2.5
0
2008-08-31T13:52:56.613
2008-11-23T14:13:43.280
2008-08-31T22:25:12.157
615
2,313
[ "closures", "boo" ]
36,867
2
null
36,417
1
null
If you decide to continue using functions, you can get some inspiration from WordPress. You can probably reduce the "program" to a minimum by making templates more granular. Also, good tools (i.e. HTML editors) can help designers ignore your PHP and work on the design without breaking the code. (But I have no suggesti...
null
CC BY-SA 2.5
null
2008-08-31T14:04:39.847
2008-09-01T10:48:00.560
2008-09-01T10:48:00.560
2,277,364
2,277,364
null
36,869
2
null
36,861
5
null
The documentation of Boo seems to be lacking in this area -- it seems that ``` setter = { value | a = value } ``` is shorthand for ``` setter = def(value): a = value ```
null
CC BY-SA 2.5
null
2008-08-31T14:10:07.383
2008-08-31T14:10:07.383
null
null
3,002
null
36,871
2
null
36,831
5
null
Also you should remember that [IPv4](http://en.wikipedia.org/wiki/IPv4) and [IPv6](http://en.wikipedia.org/wiki/IPv6) are different lengths.
null
CC BY-SA 2.5
null
2008-08-31T14:13:11.370
2008-08-31T14:13:11.370
null
null
1,736
null
36,862
1
37,006
null
99
51,942
With SVN, I had a single big repository I kept on a server, and checked-out on a few machines. This was a pretty good backup system, and allowed me easily work on any of the machines. I could checkout a specific project, commit and it updated the 'master' project, or I could checkout the entire thing. Now, I have a bu...
How do you organise multiple git repositories, so that all of them are backed up together?
CC BY-SA 3.0
0
2008-08-31T13:54:20.590
2013-04-11T06:20:26.530
2013-04-11T06:20:26.530
null
745
[ "git", "backup" ]
36,872
2
null
32,709
17
null
Robert S. is completely correct; for example:- ``` class A { static void Main() { Func<int, bool> func = i => i > 100; Predicate<int> pred = i => i > 100; Test<int>(pred, 150); Test<int>(func, 150); // Error } static void Test<T>(Predicate<T> pred, T val) { Console.WriteLine(pred(val) ? "tr...
null
CC BY-SA 2.5
null
2008-08-31T14:18:28.457
2008-08-31T14:18:28.457
null
null
3,394
null
36,873
2
null
36,682
7
null
Dependency properties are static because of a key optimization in WPF: Many of the controls in WPF have tens, if not hundreds of properties. Most of the properties in these classes are set to their default value. If DP's were instance properties, memory would need to be allocated for every property in every object yo...
null
CC BY-SA 3.0
null
2008-08-31T14:19:03.697
2012-06-13T06:53:05.180
2012-06-13T06:53:05.180
45,382
3,864
null
36,874
2
null
36,701
8
null
By the way, the structure you're giving as an example already exist in the Java base class library as `java.awt.Point`. It has x and y as public fields, [check it out for yourself](http://java.sun.com/j2se/1.4.2/docs/api/java/awt/Point.html). If you know what you're doing, and others in your team know about it, then i...
null
CC BY-SA 2.5
null
2008-08-31T14:24:06.710
2008-08-31T14:24:06.710
null
null
3,713
null
36,876
1
36,879
null
1
1,354
I am using forms authentication. My users are redirected to a page (written in web.config) when they login, but some of them may not have the privilages to access this default page. In this case, I want them to redirect to another page but RedirectFromLoginPage method always redirects to the default page in web.config....
Conditional Redirect on Login
CC BY-SA 2.5
0
2008-08-31T14:27:32.023
2012-07-16T11:45:28.327
null
null
31,505
[ "asp.net", "forms-authentication" ]
36,879
2
null
36,876
5
null
The `SetAuthCookie` allows you to issue the auth cookie but retain control over the navigation. After that method is called you can run your logic to do a typical ASP.NET redirect to wherever you want.
null
CC BY-SA 2.5
null
2008-08-31T14:32:39.187
2008-08-31T14:32:39.187
null
null
507
null
36,877
1
36,885
null
104
140,794
How can I set the cookies in my `PHP apps` as `HttpOnly cookies`?
How do you set up use HttpOnly cookies in PHP
CC BY-SA 3.0
0
2008-08-31T14:27:50.337
2023-02-09T12:36:30.437
2015-06-05T22:09:07.603
4,248,328
3,871
[ "php", "security", "cookies", "xss", "httponly" ]
36,880
2
null
36,877
5
null
Explanation here from Ilia... 5.2 only though [httpOnly cookie flag support in PHP 5.2](http://ilia.ws/archives/121-httpOnly-cookie-flag-support-in-PHP-5.2.html) As stated in that article, you can set the header yourself in previous versions of PHP ``` header("Set-Cookie: hidden=value; httpOnly"); ```
null
CC BY-SA 2.5
null
2008-08-31T14:35:02.177
2008-08-31T14:35:02.177
null
null
137
null
36,883
2
null
36,877
6
null
You can specify it in the set cookie function [see the php manual](http://uk.php.net/setcookie) ``` setcookie('Foo','Bar',0,'/', 'www.sample.com' , FALSE, TRUE); ```
null
CC BY-SA 2.5
null
2008-08-31T14:37:06.087
2008-08-31T14:37:06.087
null
null
2,098
null
36,882
2
null
36,877
9
null
``` <?php //None HttpOnly cookie: setcookie("abc", "test", NULL, NULL, NULL, NULL, FALSE); //HttpOnly cookie: setcookie("abc", "test", NULL, NULL, NULL, NULL, TRUE); ?> ``` [Source](http://ilia.ws/archives/121-httpOnly-cookie-flag-support-in-PHP-5.2.html)
null
CC BY-SA 2.5
null
2008-08-31T14:36:36.993
2008-08-31T14:36:36.993
null
null
1,585
null
36,870
2
null
36,707
10
null
There are good things to say about having a single exit-point, just as there are bad things to say about the inevitable ["arrow"](http://c2.com/cgi/wiki?ArrowAntiPattern) programming that results. If using multiple exit points during input validation or resource allocation, I try to put all the 'error-exits' very visi...
null
CC BY-SA 3.0
null
2008-08-31T14:13:10.450
2015-03-11T20:44:19.657
2015-03-11T20:44:19.657
1,542,343
2,010
null
36,884
2
null
402
40
null
From the Apple Dev Site: > To start your application in landscape mode so that the status bar is in the appropriate position immediately, edit your Info.plist file to add the UIInterfaceOrientation key with the appropriate value (UIInterfaceOrientationLandscapeRight or UIInterfaceOrientationLandscapeLe...
null
CC BY-SA 2.5
null
2008-08-31T14:38:14.460
2008-08-31T14:38:14.460
null
null
245
null
36,890
1
42,467
null
4
491
I'd like to add a method to my existing server's CORBA interface. Will that require recompiling all clients? I'm using TAO.
Changing a CORBA interface without recompiling
CC BY-SA 2.5
null
2008-08-31T14:44:18.457
2013-12-05T16:02:16.960
2008-09-04T07:29:03.150
3,583
3,583
[ "c++", "corba", "idl", "tao" ]
36,881
1
68,078
null
44
40,588
I have an activity that has a TabHost containing a set of TabSpecs each with a listview containing the items to be displayed by the tab. When each TabSpec is created, I set an icon to be displayed in the tab header. The TabSpecs are created in this way within a `setupTabs()` method which loops to create the appropriate...
Updating Android Tab Icons
CC BY-SA 4.0
0
2008-08-31T14:36:11.610
2021-05-16T16:02:48.103
2021-05-16T16:02:48.103
11,598,941
1,197
[ "java", "android", "android-tabhost" ]
36,889
1
37,066
null
6
12,807
We've been running [eAccelerator](http://eaccelerator.net/) on each of 3 webservers and are looking to move to a [memcache](http://www.danga.com/memcached/) pool across all 3, hopefully reducing by about 2/3 our db lookups. One of the handy things about eAccelerator is the web-based control interface ([control.php](ht...
Memcache control panel?
CC BY-SA 2.5
0
2008-08-31T14:41:46.857
2014-09-28T13:15:34.170
2008-09-01T08:28:09.040
2,287
2,287
[ "caching", "memcached", "controlpanel", "eaccelerator" ]
36,894
2
null
4,164
1
null
I would suggest [PmWiki](http://pmwiki.org/), it's something between a framework/wiki. By default there aren't even users, just different passwords, for different tasks, but using [PmWiki Cookbook 'recipes'](http://www.pmwiki.org/wiki/Cookbook/Cookbook/) You can add additional functionality. You can check their [philo...
null
CC BY-SA 2.5
null
2008-08-31T14:47:46.467
2008-08-31T14:47:46.467
null
null
null
null
36,891
2
null
36,701
223
null
Use common sense really. If you have something like: ``` public class ScreenCoord2D{ public int x; public int y; } ``` Then there's little point in wrapping them up in getters and setters. You're never going to store an x, y coordinate in whole pixels any other way. Getters and setters will only slow you dow...
null
CC BY-SA 3.0
null
2008-08-31T14:44:57.457
2015-08-21T08:03:42.990
2015-08-21T08:03:42.990
4,796,407
974
null
36,895
2
null
36,890
1
null
Operations (methods) are looked-up by name, so you only need to recompile the clients that use the new operation.
null
CC BY-SA 2.5
null
2008-08-31T14:53:09.323
2008-09-12T01:21:36.443
2008-09-12T01:21:36.443
2,574
2,574
null