qid
int64
4
8.14M
question
stringlengths
20
48.3k
answers
list
date
stringlengths
10
10
metadata
list
input
stringlengths
12
45k
output
stringlengths
2
31.8k
429,877
<p><strong>UPDATE 2.4.2010</strong> Yeah, this is an old question but I thought I would give an update. So, I'm working with the ReportViewer again and it's still rendering slowly on the initial load. The only difference is that the SQL database is on the reporting server.</p> <hr> <p><strong>UPDATE 3.16.2009</strong...
[ { "answer_id": 430534, "author": "joshua.ewer", "author_id": 28664, "author_profile": "https://Stackoverflow.com/users/28664", "pm_score": 2, "selected": false, "text": "<p>You can pull a report in two modes, local and server. If you're running in local mode, it's going to pull both the...
2009/01/09
[ "https://Stackoverflow.com/questions/429877", "https://Stackoverflow.com", "https://Stackoverflow.com/users/299/" ]
**UPDATE 2.4.2010** Yeah, this is an old question but I thought I would give an update. So, I'm working with the ReportViewer again and it's still rendering slowly on the initial load. The only difference is that the SQL database is on the reporting server. --- **UPDATE 3.16.2009** I have done profiling and it's not...
You can pull a report in two modes, local and server. If you're running in local mode, it's going to pull both the data and the report definition onto your machine, then render them both. In server mode, it's going to just let SSRS do all the work, then pull back the information to render. If you're using local mode, ...
429,878
<p>I'm in the process of working on a user profile system for a website and am pondering what would be a better (scalable) approach to take. I've come up with two solutions and am looking for either input or perhaps pointers to something I might have missed.</p> <p><em>The following create table statements are not mea...
[ { "answer_id": 429896, "author": "kwcto", "author_id": 45852, "author_profile": "https://Stackoverflow.com/users/45852", "pm_score": 2, "selected": false, "text": "<p>I'd use a hybrid approach. Some basic properties such as username, email, lastlogindate etc should be added to your user...
2009/01/09
[ "https://Stackoverflow.com/questions/429878", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13834/" ]
I'm in the process of working on a user profile system for a website and am pondering what would be a better (scalable) approach to take. I've come up with two solutions and am looking for either input or perhaps pointers to something I might have missed. *The following create table statements are not meant to be exec...
The hybrid solution is not a good one. Essentially you are storing additional properties into a property bag table. That is going to make doing reporting and queries complicated in the long run. Also, storing dates, int, decimal, ntext, etc. as varchar is not going to be an acceptable exchange of performance for scalab...
429,893
<p>The mysql manual says that SET NAMES 'x' is equivalent to </p> <pre><code>SET character_set_client = x; SET character_set_results=x; SET character_set_connection=x; </code></pre> <p>According to my config file for SERVER variables, I have all three of these set to utf8. </p> <p>However, if I actually do a SHOW ...
[ { "answer_id": 429949, "author": "Karptonite", "author_id": 53537, "author_profile": "https://Stackoverflow.com/users/53537", "pm_score": 3, "selected": true, "text": "<p>So I've found an answer--for some reason, I had to set:\nskip-character-set-client-handshake</p>\n\n<p>I'm not sure w...
2009/01/09
[ "https://Stackoverflow.com/questions/429893", "https://Stackoverflow.com", "https://Stackoverflow.com/users/53537/" ]
The mysql manual says that SET NAMES 'x' is equivalent to ``` SET character_set_client = x; SET character_set_results=x; SET character_set_connection=x; ``` According to my config file for SERVER variables, I have all three of these set to utf8. However, if I actually do a SHOW VARIABLES %character\_set%, it sh...
So I've found an answer--for some reason, I had to set: skip-character-set-client-handshake I'm not sure why, but it works now.
429,907
<p>Sorry, I'm not terribly experienced with Ant.</p> <p>I like the eclipse "Export ant buildfile" function, but I need to insert a few custom tasks (Copying files, calculating checksums that are used at runtime, etc).</p> <p>How do I integrate custom ant tasks with the antfile that Eclipse exports? Also, once I've d...
[ { "answer_id": 429921, "author": "Peter Hilton", "author_id": 2670, "author_profile": "https://Stackoverflow.com/users/2670", "pm_score": 2, "selected": false, "text": "<p>If you write your own Ant script, you can write your own targets that use the <a href=\"http://ant.apache.org/manual...
2009/01/09
[ "https://Stackoverflow.com/questions/429907", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12943/" ]
Sorry, I'm not terribly experienced with Ant. I like the eclipse "Export ant buildfile" function, but I need to insert a few custom tasks (Copying files, calculating checksums that are used at runtime, etc). How do I integrate custom ant tasks with the antfile that Eclipse exports? Also, once I've done so, will the i...
The ant export filter will include any xml file in the same directory which has the special ``` <?eclipse.ant.import?> ``` element as its first child. **Example:** ``` <?xml version="1.0" encoding="UTF-8"?> <?eclipse.ant.import?> <project name="project" default="default" basedir="."> ... </project> ``` Eclip...
429,912
<p>I have a query that pulls up questions from one table and answers from another.</p> <pre><code>SELECT questions.question, questions.answers, (SELECT COUNT(answer) FROM answers WHERE question_id = 1 AND answer = 1 GROUP BY answer) as ans1, (SELECT COUNT(answer) FROM answers WHERE question_id =...
[ { "answer_id": 429925, "author": "Andru Luvisi", "author_id": 5922, "author_profile": "https://Stackoverflow.com/users/5922", "pm_score": 2, "selected": false, "text": "<p>It looks pretty good to me. You could leave out the \"group by\" clauses on the subqueries since you're only select...
2009/01/09
[ "https://Stackoverflow.com/questions/429912", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2025/" ]
I have a query that pulls up questions from one table and answers from another. ``` SELECT questions.question, questions.answers, (SELECT COUNT(answer) FROM answers WHERE question_id = 1 AND answer = 1 GROUP BY answer) as ans1, (SELECT COUNT(answer) FROM answers WHERE question_id = 1 AND answer ...
``` SELECT q.question, q.answers, SUM(a.answer = 1) AS ans1, SUM(a.answer = 2) AS ans2 FROM questions q LEFT OUTER JOIN answers a ON (q.id = a.question_id) WHERE q.id = 1 GROUP BY q.id; ```
429,937
<p>How can I change the Text for a CheckBox without a postback? </p> <pre><code>&lt;asp:CheckBox ID="CheckBox1" runat="server" Text="Open" /&gt; </code></pre> <p>I would like to toggle the Text to read "Open" or "Closed" when the CheckBox is clicked on the client.</p>
[ { "answer_id": 429958, "author": "cgreeno", "author_id": 6088, "author_profile": "https://Stackoverflow.com/users/6088", "pm_score": 1, "selected": false, "text": "<p>3 Easy Options</p>\n\n<p>Use JavaScript to change the text client side- By Registering the Event in the .CS class like so...
2009/01/09
[ "https://Stackoverflow.com/questions/429937", "https://Stackoverflow.com", "https://Stackoverflow.com/users/41490/" ]
How can I change the Text for a CheckBox without a postback? ``` <asp:CheckBox ID="CheckBox1" runat="server" Text="Open" /> ``` I would like to toggle the Text to read "Open" or "Closed" when the CheckBox is clicked on the client.
``` function changeCheckboxText(checkbox) { if (checkbox.checked) checkbox.nextSibling.innerHTML = 'on text'; else checkbox.nextSibling.innerHTML = 'off text'; } ``` called as: ``` <asp:CheckBox runat="server" ID="chkTest" onclick="changeCheckboxText(this);" /> ``` Just FYI, it's usually bad practice t...
429,957
<p>When my ASP.NET application crashes (when it shows the default exception page), I'd like to be able to click on a line of the call stack in the browser and Visual Studio would open the code file at the given line.</p> <p>Do you think it's possible ? Maybe with a macro/add-in ?</p>
[ { "answer_id": 429958, "author": "cgreeno", "author_id": 6088, "author_profile": "https://Stackoverflow.com/users/6088", "pm_score": 1, "selected": false, "text": "<p>3 Easy Options</p>\n\n<p>Use JavaScript to change the text client side- By Registering the Event in the .CS class like so...
2009/01/09
[ "https://Stackoverflow.com/questions/429957", "https://Stackoverflow.com", "https://Stackoverflow.com/users/50468/" ]
When my ASP.NET application crashes (when it shows the default exception page), I'd like to be able to click on a line of the call stack in the browser and Visual Studio would open the code file at the given line. Do you think it's possible ? Maybe with a macro/add-in ?
``` function changeCheckboxText(checkbox) { if (checkbox.checked) checkbox.nextSibling.innerHTML = 'on text'; else checkbox.nextSibling.innerHTML = 'off text'; } ``` called as: ``` <asp:CheckBox runat="server" ID="chkTest" onclick="changeCheckboxText(this);" /> ``` Just FYI, it's usually bad practice t...
429,963
<p>I'm using ASP .NET MVC Beta and I get the HTTP 404 (The resource cannot be found) error when I use this url which has a "dot" at the end:</p> <p><a href="http://localhost:81/Title/Edit/Code1" rel="noreferrer">http://localhost:81/Title/Edit/Code1</a>.</p> <p>If I remove the dot at the end or the dot is somewhere in...
[ { "answer_id": 431158, "author": "recursive", "author_id": 44743, "author_profile": "https://Stackoverflow.com/users/44743", "pm_score": -1, "selected": false, "text": "<p>Perhaps <code>http://localhost:81/Title/Edit/Code1%2E</code> would work.</p>\n\n<p>I escaped the period with a hex a...
2009/01/09
[ "https://Stackoverflow.com/questions/429963", "https://Stackoverflow.com", "https://Stackoverflow.com/users/53547/" ]
I'm using ASP .NET MVC Beta and I get the HTTP 404 (The resource cannot be found) error when I use this url which has a "dot" at the end: <http://localhost:81/Title/Edit/Code1>. If I remove the dot at the end or the dot is somewhere in the middle I don't get the error. I tried to debug but it I get the error from "S...
If you are using .NET 4.0, you can set this flag in the system.web section of your web.config and it will be allowed: ``` <httpRuntime relaxedUrlToFileSystemMapping="true" /> ``` I've tested it and it works. [Haack](http://haacked.com/archive/2010/04/29/allowing-reserved-filenames-in-URLs.aspx) has an explanation of...
429,964
<p>I'm having some trouble with a large spreadsheet of mine. I bring in a lot of raw data into a data sheet, and then do a number of lookups across the data. Using built in functions I've come up with</p> <pre><code>=IF(ISNA(INDEX(Data!$L$7:$L$1100,MATCH(Data!$I$2&amp;$B$199&amp;$B29&amp;Data!$J$5,Data!$K$7:$K$1100&am...
[ { "answer_id": 430557, "author": "barrowc", "author_id": 2127508, "author_profile": "https://Stackoverflow.com/users/2127508", "pm_score": 1, "selected": false, "text": "<p>How about:</p>\n\n<pre><code>r = Range(\"Utilchassis,Utilenv,UtilITMA,UtilOS\")\n</code></pre>\n\n<p>That would see...
2009/01/09
[ "https://Stackoverflow.com/questions/429964", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I'm having some trouble with a large spreadsheet of mine. I bring in a lot of raw data into a data sheet, and then do a number of lookups across the data. Using built in functions I've come up with ``` =IF(ISNA(INDEX(Data!$L$7:$L$1100,MATCH(Data!$I$2&$B$199&$B29&Data!$J$5,Data!$K$7:$K$1100&Data!$J$7:$J$1100&Data!$I$7:...
How about: ``` r = Range("Utilchassis,Utilenv,UtilITMA,UtilOS") ``` That would seem to achieve the same as your Concat function
429,979
<p>We currently have "gacutil /i $(TargetPath)" as an external tool in visual studio and it works fine for gac'n a single project.</p> <p>I want to be able to select multiple projects and gac them so I put together a batch script to test.</p> <pre><code>set randomfile=%random% echo %1 %2 %3 &gt; %randomfile% gacuti...
[ { "answer_id": 429992, "author": "Sergey Golovchenko", "author_id": 26592, "author_profile": "https://Stackoverflow.com/users/26592", "pm_score": 3, "selected": true, "text": "<p>Been using Linode for several months, it took less than an hour to set up the the virtual \"boxes\", and we h...
2009/01/09
[ "https://Stackoverflow.com/questions/429979", "https://Stackoverflow.com", "https://Stackoverflow.com/users/45005/" ]
We currently have "gacutil /i $(TargetPath)" as an external tool in visual studio and it works fine for gac'n a single project. I want to be able to select multiple projects and gac them so I put together a batch script to test. ``` set randomfile=%random% echo %1 %2 %3 > %randomfile% gacutil.exe /f /il %randomfile...
Been using Linode for several months, it took less than an hour to set up the the virtual "boxes", and we haven't touched it since, so from my point of view (as a developer) that gets two thumbs up. Using Ubuntu and haven't encountered any problems since initial setup. Haven't used Slicehost but frankly after the sim...
429,995
<p>I am trying to figure out how C and C++ store large objects on the stack. Usually, the stack is the size of an integer, so I don't understand how larger objects are stored there. Do they simply take up multiple stack "slots"?</p>
[ { "answer_id": 430002, "author": "Jimmy", "author_id": 4435, "author_profile": "https://Stackoverflow.com/users/4435", "pm_score": 0, "selected": false, "text": "<p>By \"stack is size of an integer\", you mean \"the stack pointer is the size of an integer\". It points to the top of the s...
2009/01/09
[ "https://Stackoverflow.com/questions/429995", "https://Stackoverflow.com", "https://Stackoverflow.com/users/53557/" ]
I am trying to figure out how C and C++ store large objects on the stack. Usually, the stack is the size of an integer, so I don't understand how larger objects are stored there. Do they simply take up multiple stack "slots"?
The stack is a piece of memory. The stack pointer points to the top. Values can be pushed on the stack and popped to retrieve them. For example if we have a function which is called with two parameters (1 byte sized and the other 2 byte sized; just assume we have an 8-bit PC). Both are pushed on the stack this moves ...
429,999
<p>I need to extract options in ``particular select tag. Is it possible to accomplish using one regex or I'll have to capture the inner html of select first and then the options? Here is an example of html:</p> <pre><code>&lt;select id="select_id"&gt; &lt;option selected value=""&gt;Select Type&lt;/option&gt; ...
[ { "answer_id": 430003, "author": "Godeke", "author_id": 28006, "author_profile": "https://Stackoverflow.com/users/28006", "pm_score": 2, "selected": true, "text": "<p>While it is possible to construct a regex that would do what you want, I really thing you would be happier doing it via t...
2009/01/09
[ "https://Stackoverflow.com/questions/429999", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42646/" ]
I need to extract options in ``particular select tag. Is it possible to accomplish using one regex or I'll have to capture the inner html of select first and then the options? Here is an example of html: ``` <select id="select_id"> <option selected value="">Select Type</option> <option value="1">1</option> ...
While it is possible to construct a regex that would do what you want, I really thing you would be happier doing it via the DOM, unless you have some reason to not use the DOM. There are no tags that suggest language or platform, so it is hard to get more specific than that. Any specific reason for trying to parse HTM...
430,000
<p>I'm trying to figure out how to exclude items from a select statement from table A using an exclusion list from table B. The catch is that I'm excluding based on the prefix of a field.</p> <p>So a field value maybe "FORD Muffler" and to exclude it from a basic query I would do:</p> <pre><code>SELECT FieldName FRO...
[ { "answer_id": 430018, "author": "Joel Coehoorn", "author_id": 3043, "author_profile": "https://Stackoverflow.com/users/3043", "pm_score": 4, "selected": true, "text": "<p>I think this will do it:</p>\n\n<pre><code>SELECT FieldName\nFROM TableName\nLEFT JOIN TableName2 ON UPPER(ColumnNam...
2009/01/09
[ "https://Stackoverflow.com/questions/430000", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8664/" ]
I'm trying to figure out how to exclude items from a select statement from table A using an exclusion list from table B. The catch is that I'm excluding based on the prefix of a field. So a field value maybe "FORD Muffler" and to exclude it from a basic query I would do: ``` SELECT FieldName FROM TableName WHERE UP...
I think this will do it: ``` SELECT FieldName FROM TableName LEFT JOIN TableName2 ON UPPER(ColumnName) LIKE TableName2.FieldName2 + '%' WHERE TableName2.FieldName2 IS NULL ```
430,012
<p>I need to store whether something happens once, daily, weekdays, weekly, some days of the week, some days of the month, which may be numerical or symbolic, like first Monday of each month, and so on.</p> <p>Any recommendations? Any code, data structure or schema to look at?</p>
[ { "answer_id": 430051, "author": "Tim", "author_id": 10755, "author_profile": "https://Stackoverflow.com/users/10755", "pm_score": 1, "selected": false, "text": "<p>Try an open source project that has scheduling functionality?</p>\n<p>Some scheduling interface/definitions</p>\n<p><a href...
2009/01/09
[ "https://Stackoverflow.com/questions/430012", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6068/" ]
I need to store whether something happens once, daily, weekdays, weekly, some days of the week, some days of the month, which may be numerical or symbolic, like first Monday of each month, and so on. Any recommendations? Any code, data structure or schema to look at?
There are complex solutions and easy solutions. The two easiest solutions are: 1. Fan out recurring events up to some constant number of instances, or up to some fixed date range in the future. Store a FK recurrence\_id with each instance that points to a description of the recurrence, and allows for mass editing and ...
430,047
<p>Assume infile is a variable holding the name of an input file, and similarly outfile for output file. If infile ends in <strong>.js</strong>, I'd like to replace with <strong>.min.js</strong> and that's easy enough (I think).</p> <p><strong>outfile = re.sub(r'\b.js$', '.min.js', infile)</strong></p> <p>But my que...
[ { "answer_id": 430064, "author": "Evan Fosmark", "author_id": 49701, "author_profile": "https://Stackoverflow.com/users/49701", "pm_score": 4, "selected": true, "text": "<p>You want to do a negative lookbehind assertion. For instance,</p>\n\n<pre><code>outfile = re.sub(r\"(?&lt;!\\.min)\...
2009/01/09
[ "https://Stackoverflow.com/questions/430047", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1244013/" ]
Assume infile is a variable holding the name of an input file, and similarly outfile for output file. If infile ends in **.js**, I'd like to replace with **.min.js** and that's easy enough (I think). **outfile = re.sub(r'\b.js$', '.min.js', infile)** But my question is if infile ends in **.min.js**, then I do not wan...
You want to do a negative lookbehind assertion. For instance, ``` outfile = re.sub(r"(?<!\.min)\.js$", ".min.js", infile) ``` You can find more about this here: <http://docs.python.org/library/re.html#regular-expression-syntax>
430,056
<p>What is the best way of referencing a dynamic delegate. I'd like to do the following with method names returned from a configuration database. </p> <pre><code>AddressOf "MethodName" </code></pre>
[ { "answer_id": 430061, "author": "ctacke", "author_id": 13154, "author_profile": "https://Stackoverflow.com/users/13154", "pm_score": 3, "selected": true, "text": "<p>Via Reflection (specifically <a href=\"http://msdn.microsoft.com/en-us/library/system.type.getmethod.aspx\" rel=\"nofollo...
2009/01/09
[ "https://Stackoverflow.com/questions/430056", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11627/" ]
What is the best way of referencing a dynamic delegate. I'd like to do the following with method names returned from a configuration database. ``` AddressOf "MethodName" ```
Via Reflection (specifically [Type.GetMethod](http://msdn.microsoft.com/en-us/library/system.type.getmethod.aspx)).
430,074
<p>Suppose you use the following structure:</p> <pre><code>var Args = new Object(); Args.Age = '10'; Args.Weight = '10'; Args.GetAge = function() { return 'I am ' + Age + ' years old'; } Args.GetWeight = function() { return 'I weigh ' + Weight + ' pounds'; } </code></pre> <p>That works great. But is it pos...
[ { "answer_id": 430080, "author": "Robert C. Barth", "author_id": 9209, "author_profile": "https://Stackoverflow.com/users/9209", "pm_score": 3, "selected": true, "text": "<p>You can access properties via [] notation:</p>\n\n<pre><code>alert(Args[\"Age\"]);\n</code></pre>\n\n<p>And, as st...
2009/01/09
[ "https://Stackoverflow.com/questions/430074", "https://Stackoverflow.com", "https://Stackoverflow.com/users/51949/" ]
Suppose you use the following structure: ``` var Args = new Object(); Args.Age = '10'; Args.Weight = '10'; Args.GetAge = function() { return 'I am ' + Age + ' years old'; } Args.GetWeight = function() { return 'I weigh ' + Weight + ' pounds'; } ``` That works great. But is it possible to use a generic so y...
You can access properties via [] notation: ``` alert(Args["Age"]); ``` And, as stated below, you can also just read the value via .Age or .Weight: ``` alert(Args.Age); ``` That seemed kind of obvious, so I thought you were looking for something else. BTW, you can simplify your object creation to: ``` var args =...
430,078
<p>What would be your suggestions for a good bash/ksh script template to use as a standard for all newly created scripts?</p> <p>I usually start (after the <code>#!</code> line) with a commented-out header with a filename, synopsis, usage, return values, author(s), changelog and would fit into 80-char lines.</p> <p>A...
[ { "answer_id": 430600, "author": "Norman Ramsey", "author_id": 41661, "author_profile": "https://Stackoverflow.com/users/41661", "pm_score": 2, "selected": false, "text": "<p>I would suggest </p>\n\n<pre><code>#!/bin/ksh\n</code></pre>\n\n<p>and that's it. Heavyweight block comments for...
2009/01/09
[ "https://Stackoverflow.com/questions/430078", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7229/" ]
What would be your suggestions for a good bash/ksh script template to use as a standard for all newly created scripts? I usually start (after the `#!` line) with a commented-out header with a filename, synopsis, usage, return values, author(s), changelog and would fit into 80-char lines. All documentation lines I sta...
I'd extend Norman's answer to 6 lines, and the last of those is blank: ``` #!/bin/ksh # # @(#)$Id$ # # Purpose ``` The third line is a version control identification string - it is actually a hybrid with an SCCS marker '`@(#)`' that can be identified by the (SCCS) program `what` and an RCS version string which is ex...
430,079
<p>I'd like to split strings like these</p> <pre><code>'foofo21' 'bar432' 'foobar12345' </code></pre> <p>into</p> <pre><code>['foofo', '21'] ['bar', '432'] ['foobar', '12345'] </code></pre> <p>Does somebody know an easy and simple way to do this in python?</p>
[ { "answer_id": 430102, "author": "Evan Fosmark", "author_id": 49701, "author_profile": "https://Stackoverflow.com/users/49701", "pm_score": 7, "selected": true, "text": "<p>I would approach this by using <code>re.match</code> in the following way:</p>\n<pre><code>import re\nmatch = re.m...
2009/01/09
[ "https://Stackoverflow.com/questions/430079", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7029/" ]
I'd like to split strings like these ``` 'foofo21' 'bar432' 'foobar12345' ``` into ``` ['foofo', '21'] ['bar', '432'] ['foobar', '12345'] ``` Does somebody know an easy and simple way to do this in python?
I would approach this by using `re.match` in the following way: ``` import re match = re.match(r"([a-z]+)([0-9]+)", 'foofo21', re.I) if match: items = match.groups() print(items) >> ("foofo", "21") ```
430,125
<p>I have a data structure that represents C# code like this:</p> <pre><code>class Namespace: string Name; List&lt;Class&gt; Classes; class Class: string Name; List&lt;Property&gt; Properties; List&lt;Method&gt; Methods; List&lt;Method&gt; Constructors; List&lt;Field&gt; Fields; List&l...
[ { "answer_id": 430138, "author": "Jimmy McNulty", "author_id": 53523, "author_profile": "https://Stackoverflow.com/users/53523", "pm_score": 2, "selected": true, "text": "<p>You could try to aggregate your 3000 rules. Some of the 3000, I would guess assume another member of the 3000. S...
2009/01/09
[ "https://Stackoverflow.com/questions/430125", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I have a data structure that represents C# code like this: ``` class Namespace: string Name; List<Class> Classes; class Class: string Name; List<Property> Properties; List<Method> Methods; List<Method> Constructors; List<Field> Fields; List<Class> InnerClasses; Class Parent; Li...
You could try to aggregate your 3000 rules. Some of the 3000, I would guess assume another member of the 3000. Say rule 12 checks 'a class implements an interface'. Rule 85 might be 'a class only implements interfaces in the same assembly'. If rule 12 fails, no need to run rule 85 at all. This approach (alpha-beta pru...
430,127
<p>I've done several Google searches and can't find a good sample to stop/start the 'Default Web Site' (in II6) using PowerShell. </p> <p>This...</p> <pre><code>$server = "localhost" $siteName = "default web site" $iis = [ADSI]"IIS://$server/W3SVC" $site = $iis.psbase.children | where { $_.keyType -eq "IIsWebServer"...
[ { "answer_id": 430679, "author": "Mitch Wheat", "author_id": 16076, "author_profile": "https://Stackoverflow.com/users/16076", "pm_score": 0, "selected": false, "text": "<p>Can you not use the <a href=\"http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/d3df4bc9-0...
2009/01/09
[ "https://Stackoverflow.com/questions/430127", "https://Stackoverflow.com", "https://Stackoverflow.com/users/81/" ]
I've done several Google searches and can't find a good sample to stop/start the 'Default Web Site' (in II6) using PowerShell. This... ``` $server = "localhost" $siteName = "default web site" $iis = [ADSI]"IIS://$server/W3SVC" $site = $iis.psbase.children | where { $_.keyType -eq "IIsWebServer" -AND $_.Serv...
Check the serverState property. A value of 2 means running and a value of 3 means stopped, you can set them this way: start the website ----------------- $site.serverState = 2 $site.setInfo() stop the website ---------------- $site.serverState = 3 $site.setInfo()
430,128
<p>I am working on a javascript app that users load via a configurable script tag. I have it hosted on its own Google Code project since its open source. Is it ok to have the url that loads the app pointed at the file download link on its Code site? For example:</p> <pre><code>&lt;script type="text/javascript" src="ht...
[ { "answer_id": 430143, "author": "Luca Matteis", "author_id": 50394, "author_profile": "https://Stackoverflow.com/users/50394", "pm_score": 3, "selected": true, "text": "<p><a href=\"http://code.google.com/tos.html\" rel=\"nofollow noreferrer\">http://code.google.com/tos.html</a></p>\n\n...
2009/01/09
[ "https://Stackoverflow.com/questions/430128", "https://Stackoverflow.com", "https://Stackoverflow.com/users/68788/" ]
I am working on a javascript app that users load via a configurable script tag. I have it hosted on its own Google Code project since its open source. Is it ok to have the url that loads the app pointed at the file download link on its Code site? For example: ``` <script type="text/javascript" src="http://myprojectnam...
<http://code.google.com/tos.html> > > You agree that Google has no responsibility or liability for the deletion or failure to store any Content and other communications maintained or transmitted by Google services. You acknowledge that Google may have set no fixed upper limit on the number of transmissions you may se...
430,145
<p>After writing code to populate textboxes from an object, such as:</p> <pre><code>txtFirstName.Text = customer.FirstName; txtLastName.Text = customer.LastName; txtAddress.Text = customer.Address; txtCity.Text = customer.City; </code></pre> <p>is there way in Visual Studio (or even something like Resharper) to copy ...
[ { "answer_id": 430155, "author": "Marc Gravell", "author_id": 23354, "author_profile": "https://Stackoverflow.com/users/23354", "pm_score": 2, "selected": false, "text": "<p>None that I know of. Of course, if you use one of the many binding approaches available, then you won't have to - ...
2009/01/09
[ "https://Stackoverflow.com/questions/430145", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10276/" ]
After writing code to populate textboxes from an object, such as: ``` txtFirstName.Text = customer.FirstName; txtLastName.Text = customer.LastName; txtAddress.Text = customer.Address; txtCity.Text = customer.City; ``` is there way in Visual Studio (or even something like Resharper) to copy and paste this code into a...
Before VS2012: * Copy and paste the original block of code * Select it again in the place you want to switch * Press Ctrl-H to get the "Replace" box up * Under "Find what" put: `{[a-zA-Z\.]*} = {[a-zA-Z\.]*};` * Under "Replace with" put: `\2 = \1;` * Look in: "Selection" * Use: "Regular expressions" * Hit Replace All ...
430,161
<p>When I submit a form in HTML, I can pass a parameter multiple times, e.g.</p> <pre><code>&lt;input type="hidden" name="id" value="2"&gt; &lt;input type="hidden" name="id" value="4"&gt; </code></pre> <p>Then in struts I can have a bean with property String[] id, and it'll populate the array correctly.</p> <p>My qu...
[ { "answer_id": 430185, "author": "AnthonyWJones", "author_id": 17516, "author_profile": "https://Stackoverflow.com/users/17516", "pm_score": 1, "selected": false, "text": "<p>One approach would be to give each input a unique ID:-</p>\n\n<pre><code>&lt;input id=\"id1\" type=\"hidden\" nam...
2009/01/09
[ "https://Stackoverflow.com/questions/430161", "https://Stackoverflow.com", "https://Stackoverflow.com/users/45856/" ]
When I submit a form in HTML, I can pass a parameter multiple times, e.g. ``` <input type="hidden" name="id" value="2"> <input type="hidden" name="id" value="4"> ``` Then in struts I can have a bean with property String[] id, and it'll populate the array correctly. My question is, how can I do that in Javascript? W...
Is this what you're looking for? It generates a hidden form field for each element of a JavaScript array: ``` var el; for (var i = 0; i < myArray.length) { el = document.createElement("input"); el.type = "hidden"; el.name = "id"; el.value = myArray[i]; // Optional: give each input an id so they ca...
430,163
<p>I have this piece of code</p> <pre><code>#include &lt;stdio.h&gt; #include &lt;stdlib.h&gt; #include &lt;stdint.h&gt; #include &lt;string.h&gt; int main(){ void *a, *b; a = malloc(16); b = malloc(16); printf("\n block size (for a): %p-%p : %li", b, a, b-a); a = malloc(1024); b = malloc(...
[ { "answer_id": 430165, "author": "Ronny Brendel", "author_id": 14114, "author_profile": "https://Stackoverflow.com/users/14114", "pm_score": 1, "selected": false, "text": "<p>Before the pointer stands the size of the following array, which is a 32/64 bit integer (dont know if signed or u...
2009/01/09
[ "https://Stackoverflow.com/questions/430163", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11301/" ]
I have this piece of code ``` #include <stdio.h> #include <stdlib.h> #include <stdint.h> #include <string.h> int main(){ void *a, *b; a = malloc(16); b = malloc(16); printf("\n block size (for a): %p-%p : %li", b, a, b-a); a = malloc(1024); b = malloc(1024); printf("\n block size (fo...
You have a bug. Instead of: ``` translatedArray=malloc(4*sizeof(short int)); ``` You should have ``` translatedArray=malloc(4*sizeof(short int*)); ``` Note the missing pointer in your code. I suspect this is where your observed behavior stems from. --- Also notice that `0x804a420 - 0x804a018 = 1032`, not `516`....
430,176
<p>Hello I am working with a simulator that uses rcS scripts to boot, this is my script</p> <pre><code>cd /tests ./test1 &amp; ./test2 &amp; ./test3 &amp; ./test4 exit </code></pre> <p>What I want is run all the test at the same time and that the exit command is executed only when all the previous test have finished...
[ { "answer_id": 430190, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 2, "selected": false, "text": "<p>Something along the lines of </p>\n\n<pre><code>cd /tests\n./test1 &amp;\n./test2 &amp;\n./test3 &amp;\n./test4 &amp;\nwait...
2009/01/09
[ "https://Stackoverflow.com/questions/430176", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39160/" ]
Hello I am working with a simulator that uses rcS scripts to boot, this is my script ``` cd /tests ./test1 & ./test2 & ./test3 & ./test4 exit ``` What I want is run all the test at the same time and that the exit command is executed only when all the previous test have finished. And not only when test 4 has finishe...
You can use wait: ``` ./test1 & ./test2 & ./test3 & ./test4 & wait ``` From the bash man page: > > wait [n ...] > Wait for each specified process and return its > termination status. Each n may be a > process ID or a job specification; if > a job spec is given, all processes in > that job's pipeline are waite...
430,188
<p>I'm trying to learn more about db interactions which has me developing a local app to get started. Well, basically, what I've done so far has had some mixed results and I've changed so much stuff I'm not even sure what I've change at this point, lol. I'm not quite sure one of my tables was correct, so I've decided t...
[ { "answer_id": 430221, "author": "Sam", "author_id": 37379, "author_profile": "https://Stackoverflow.com/users/37379", "pm_score": 1, "selected": false, "text": "<p>Since your feed table will be holding feeds for all your users, you might need to rethink this. </p>\n\n<p>You have set th...
2009/01/09
[ "https://Stackoverflow.com/questions/430188", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I'm trying to learn more about db interactions which has me developing a local app to get started. Well, basically, what I've done so far has had some mixed results and I've changed so much stuff I'm not even sure what I've change at this point, lol. I'm not quite sure one of my tables was correct, so I've decided to j...
Since your feed table will be holding feeds for all your users, you might need to rethink this. You have set the default to 1 for the feed\_id, so you will get 1 for everything - you will not get 2 when adding a second feed for a user. You will need logic. Perhaps when a user creates a new feed, you would query for ...
430,226
<p>I need to poll a web service, in this case twitter's API, and I'm wondering what the conventional wisdom is on this topic. I'm not sure whether this is important, but I've always found feedback useful in the past.</p> <p>A couple scenarios I've come up with:</p> <ol> <li><p>The querying process starts every X seco...
[ { "answer_id": 430245, "author": "BobbyShaftoe", "author_id": 38426, "author_profile": "https://Stackoverflow.com/users/38426", "pm_score": 0, "selected": false, "text": "<p>You should have a page that is like a Ping or Heartbeat page. The you have another process that \"tickles\" or hit...
2009/01/10
[ "https://Stackoverflow.com/questions/430226", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I need to poll a web service, in this case twitter's API, and I'm wondering what the conventional wisdom is on this topic. I'm not sure whether this is important, but I've always found feedback useful in the past. A couple scenarios I've come up with: 1. The querying process starts every X seconds, eg a cron job runs...
"Do I just run a python script that doesn't end?" How is this unfamiliar territory? ``` import time polling_interval = 36.0 # (100 requests in 3600 seconds) running= True while running: start= time.clock() poll_twitter() anything_else_that_seems_important() work_duration = time.clock() - start tim...
430,256
<p>Does .net have a way to determine whether the local filesystem is case-sensitive?</p>
[ { "answer_id": 430260, "author": "ScottS", "author_id": 51851, "author_profile": "https://Stackoverflow.com/users/51851", "pm_score": 1, "selected": false, "text": "<p>Try creating a temporary file in all lowercase, and then check if it exists using uppercase.</p>\n" }, { "answer...
2009/01/10
[ "https://Stackoverflow.com/questions/430256", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2338/" ]
Does .net have a way to determine whether the local filesystem is case-sensitive?
You can create a file in the temp folder (using lowercase filename), then check if the file exists (using uppercase filename), e.g: ``` string file = Path.GetTempPath() + Guid.NewGuid().ToString().ToLower(); File.CreateText(file).Close(); bool isCaseInsensitive = File.Exists(file.ToUpper()); File.Delete(file); ```
430,264
<p>Given an enum that has assigned values, what is the best way to get the next or previous enum given a value. For example, consider this enum:</p> <pre><code>public enum TimeframeType { None = 0, [Description("1 month")] Now = 30, [Description("1-3 months")] Short = 90, [Description("3-6 mont...
[ { "answer_id": 430267, "author": "Jimmy McNulty", "author_id": 53523, "author_profile": "https://Stackoverflow.com/users/53523", "pm_score": 4, "selected": true, "text": "<p>You are trying to solve the wrong problem. This is far too complex for a simple enum to calculate. Refactor the e...
2009/01/10
[ "https://Stackoverflow.com/questions/430264", "https://Stackoverflow.com", "https://Stackoverflow.com/users/40161/" ]
Given an enum that has assigned values, what is the best way to get the next or previous enum given a value. For example, consider this enum: ``` public enum TimeframeType { None = 0, [Description("1 month")] Now = 30, [Description("1-3 months")] Short = 90, [Description("3-6 months")] Medi...
You are trying to solve the wrong problem. This is far too complex for a simple enum to calculate. Refactor the enum to a class and use a comparison interface. If this route is open to you look at how this *could* be implemented by a class: ``` public class TimeFrame: IComparable { private int days; public in...
430,274
<p>Found the following in an Oracle-based application that we're migrating <em>(generalized)</em>:</p> <pre><code>SELECT Table1.Category1, Table1.Category2, count(*) as Total, count(Tab2.Stat) AS Stat FROM Table1, Table2 WHERE (Table1.PrimaryKey = Table2.ForeignKey(+)) GROUP BY Table1.Category1, Table1...
[ { "answer_id": 430276, "author": "Otávio Décio", "author_id": 48684, "author_profile": "https://Stackoverflow.com/users/48684", "pm_score": 3, "selected": false, "text": "<p>It's a non ANSI left outer join notation. Starting with Oracle9i, the confusing outer join syntax using the ‘(+)’ ...
2009/01/10
[ "https://Stackoverflow.com/questions/430274", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15031/" ]
Found the following in an Oracle-based application that we're migrating *(generalized)*: ``` SELECT Table1.Category1, Table1.Category2, count(*) as Total, count(Tab2.Stat) AS Stat FROM Table1, Table2 WHERE (Table1.PrimaryKey = Table2.ForeignKey(+)) GROUP BY Table1.Category1, Table1.Category2 ``` What...
Depending on which side of the "=" the "(+) is on, it denotes a LEFT OUTER or a RIGHT OUTER join (in this case, it's a left outer join). It's old Oracle syntax that is sometimes preferred by people who learned it first, since they like that it makes their code shorter. Best not to use it though, for readability's sake...
430,313
<p>Consider the following snippet:</p> <pre><code> using System; using System.Collections.Generic; using System.Linq; using System.Net; namespace ForumLogins { public class VBULLETIN { HttpWebRequest request; public void ForumLogins(string url) { request = (HttpWebReques...
[ { "answer_id": 430331, "author": "JoshBerke", "author_id": 26160, "author_profile": "https://Stackoverflow.com/users/26160", "pm_score": 1, "selected": false, "text": "<p>What you do depends on the role of the code. If this is a library that your going to share I'd recommend you wrap all...
2009/01/10
[ "https://Stackoverflow.com/questions/430313", "https://Stackoverflow.com", "https://Stackoverflow.com/users/50312/" ]
Consider the following snippet: ``` using System; using System.Collections.Generic; using System.Linq; using System.Net; namespace ForumLogins { public class VBULLETIN { HttpWebRequest request; public void ForumLogins(string url) { request = (HttpWebRequest)WebRequest.Cre...
If your constructor can fail, then you should probably let the person who implements the class handle the errors. Just be sure to document the fact that it might fail so they know to try/catch. On a related note, constructors should never fail. =) Instead, put the logic that can possibly fail into a "Go()" method. Th...
430,324
<p>I'm looking over my syllabus for my theoretical computer science class and within the heading of Context Free Grammars it lists "closure properties". I have looked through my textbook on this subject and found quite little. The little it does have is a bit above my head at the moment (I haven't taken the course yet)...
[ { "answer_id": 430343, "author": "Darius Bacon", "author_id": 27024, "author_profile": "https://Stackoverflow.com/users/27024", "pm_score": 3, "selected": false, "text": "<p>A closure property is like this: if L and M are context-free languages, then so is L|M. Function closures are a wa...
2009/01/10
[ "https://Stackoverflow.com/questions/430324", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34235/" ]
I'm looking over my syllabus for my theoretical computer science class and within the heading of Context Free Grammars it lists "closure properties". I have looked through my textbook on this subject and found quite little. The little it does have is a bit above my head at the moment (I haven't taken the course yet) bu...
The term "closure" is used an a variety of ways, mostly tracking back to a Mathematical concept of completion, in some sense. * An operator is "closed over" a set of values if applying that operator to values from the set always produces a value from the given set. For example, addition is closed over the integers, bu...
430,326
<pre><code>$story_query = "SELECT table_name, id FROM planning WHERE parent = '$novelnum'"; $story_result = db_query($story_query); while($story_row = db_fetch_array($story_result)) { $taleTable_Name = $story_row['table_name']; $postid[] = $story_row['id']; $q2 = "Select * from $taleTable_Name where approv...
[ { "answer_id": 430532, "author": "George Stocker", "author_id": 16587, "author_profile": "https://Stackoverflow.com/users/16587", "pm_score": 2, "selected": false, "text": "<p>First off, I have no idea what your variable names mean. I've tried to guesstimate, but you should look into re...
2009/01/10
[ "https://Stackoverflow.com/questions/430326", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
``` $story_query = "SELECT table_name, id FROM planning WHERE parent = '$novelnum'"; $story_result = db_query($story_query); while($story_row = db_fetch_array($story_result)) { $taleTable_Name = $story_row['table_name']; $postid[] = $story_row['id']; $q2 = "Select * from $taleTable_Name where approved='Y' ...
First off, I have no idea what your variable names mean. I've tried to guesstimate, but you should look into renaming them. To keep the sanity of your maintanence programmer. Looking at your code, I know what it's doing, but I have no idea what it's supposed to do, or why. Below is an attempt to rename your variable n...
430,330
<p>I have an enumeration for Status for a Task. Some of the statuses are considered obsolete, and I have marked them as obsolete, as seen below:</p> <pre><code>public enum TaskStatus { [Description("")] NotSet = 0, Pending = 1, Ready = 2, Open = 3, Completed = 4, Closed = 5, [Descripti...
[ { "answer_id": 430335, "author": "masfenix", "author_id": 50312, "author_profile": "https://Stackoverflow.com/users/50312", "pm_score": 0, "selected": false, "text": "<p>You can use the <a href=\"http://msdn.microsoft.com/en-us/library/system.diagnostics.debuggerhiddenattribute.aspx\" re...
2009/01/10
[ "https://Stackoverflow.com/questions/430330", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1768/" ]
I have an enumeration for Status for a Task. Some of the statuses are considered obsolete, and I have marked them as obsolete, as seen below: ``` public enum TaskStatus { [Description("")] NotSet = 0, Pending = 1, Ready = 2, Open = 3, Completed = 4, Closed = 5, [Description("On Hold")][...
You could write a LINQ-query: ``` var availableTaks = typeof (TaskStatus).GetFields(BindingFlags.Static | BindingFlags.GetField | BindingFlags.Public) .Where(f => f.GetCustomAttributes(typeof (ObsoleteAttribute), false).Length == 0); foreach(var task in availableTaks) Console.WriteLine(task); ```
430,349
<p>When the source of an iframe is:</p> <pre><code>javascript:''; </code></pre> <p>as in:</p> <pre><code>&lt;iframe id="SpControlFrame1" name="SpControlFrame1" src="javascript:'';" path_src="index.php?cmd=YYY" &gt;&lt;/iframe&gt; </code></pre> <p>What is going on? What does the src="javascript:'';" tell the browser...
[ { "answer_id": 430359, "author": "Ates Goral", "author_id": 23501, "author_profile": "https://Stackoverflow.com/users/23501", "pm_score": 5, "selected": true, "text": "<p>It tells the browser to display the result of executing the empty string literal. Therefore, it would just display an...
2009/01/10
[ "https://Stackoverflow.com/questions/430349", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29505/" ]
When the source of an iframe is: ``` javascript:''; ``` as in: ``` <iframe id="SpControlFrame1" name="SpControlFrame1" src="javascript:'';" path_src="index.php?cmd=YYY" ></iframe> ``` What is going on? What does the src="javascript:'';" tell the browser to do? what does the "path\_src" do? Thanks Chris
It tells the browser to display the result of executing the empty string literal. Therefore, it would just display an empty string. You can test the effect of this by typing in `javascript:'http://stackoverflow.com';` in the address bar of a normal window/tab. You'll get a white page that says "<http://stackoverflow.c...
430,358
<p>I now have it set up so that when people go to a "thank you" page after filling out a form, they go to a page that says: </p> <pre><code> thanks for coming &lt;a href="&lt;?php echo $_SERVER['HTTP_REFERER'] ?&gt;here's a link back to where you came from&lt;/a&gt; </code></pre> <p>What I want is for it to say:</p...
[ { "answer_id": 430365, "author": "Oddthinking", "author_id": 8014, "author_profile": "https://Stackoverflow.com/users/8014", "pm_score": 0, "selected": false, "text": "<p>If the referring page is under your control, you could set a cookie on each page of your site, equal to the title.</p...
2009/01/10
[ "https://Stackoverflow.com/questions/430358", "https://Stackoverflow.com", "https://Stackoverflow.com/users/43035/" ]
I now have it set up so that when people go to a "thank you" page after filling out a form, they go to a page that says: ``` thanks for coming <a href="<?php echo $_SERVER['HTTP_REFERER'] ?>here's a link back to where you came from</a> ``` What I want is for it to say: ``` thanks for coming <a href="<?php ec...
The simplest way is to pass the page title as a session variable: ``` <?php $_Session["referrerTitle"] = $pageTitle; ?> ``` If you are working with a Header file include, you may have this variable set already in the referring page. Then in your link: ``` <p> thanks for coming <a href="<?= $_SERVER['HTTP_...
430,388
<p>We have a modem terminal application written in VB6. It works great for what we need it to do, but there is a new requirement to initiate a VPN connection when dialing a particular provider. I've looked over some related posts and it looks like this may be possible using the RAS API. Can anyone suggest resources/adv...
[ { "answer_id": 430456, "author": "Spencer Ruport", "author_id": 52551, "author_profile": "https://Stackoverflow.com/users/52551", "pm_score": 1, "selected": false, "text": "<p>Is .Net completely not an option or is it not an option to switch everything you have into .Net? You could creat...
2009/01/10
[ "https://Stackoverflow.com/questions/430388", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23114/" ]
We have a modem terminal application written in VB6. It works great for what we need it to do, but there is a new requirement to initiate a VPN connection when dialing a particular provider. I've looked over some related posts and it looks like this may be possible using the RAS API. Can anyone suggest resources/advice...
This may not be as robust as you need, but I have called out to the system rasdial command in the past for simple situations where I needed to setup a VPN connection. ``` USAGE: rasdial entryname [username [password|*]] [/DOMAIN:domain] [/PHONE:phonenumber] [/CALLBACK:callbacknumber] ...
430,403
<p>I have a localization issue.</p> <p>One of my industrious coworkers has replaced all the strings throughout our application with constants that are contained in a dictionary. That dictionary gets various strings placed in it once the user selects a language (English by default, but target languages are German, Spa...
[ { "answer_id": 430415, "author": "Sean", "author_id": 25640, "author_profile": "https://Stackoverflow.com/users/25640", "pm_score": 0, "selected": false, "text": "<p>I was having a similar problem just the other day - see <a href=\"https://stackoverflow.com/questions/420659/unicode-chara...
2009/01/10
[ "https://Stackoverflow.com/questions/430403", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21981/" ]
I have a localization issue. One of my industrious coworkers has replaced all the strings throughout our application with constants that are contained in a dictionary. That dictionary gets various strings placed in it once the user selects a language (English by default, but target languages are German, Spanish, Frenc...
I have a very short [guide to debugging Unicode problems](http://pobox.com/~skeet/csharp/debuggingunicode.html). It's targeted at fetching text from databases, but the same principles apply in general. The most important starting point IMO is to know what's actually in your string when it just shows a box. Dump the co...
430,424
<p>I would like to detect whether the OS I'm compiling on is Windows. Is there a simple macro I can check to verify that?</p>
[ { "answer_id": 430435, "author": "Phil Hord", "author_id": 33342, "author_profile": "https://Stackoverflow.com/users/33342", "pm_score": 6, "selected": true, "text": "<p><em>[Edit: I assume you want to use compile-time macros to determine which environment you're on. Maybe you want to d...
2009/01/10
[ "https://Stackoverflow.com/questions/430424", "https://Stackoverflow.com", "https://Stackoverflow.com/users/53602/" ]
I would like to detect whether the OS I'm compiling on is Windows. Is there a simple macro I can check to verify that?
*[Edit: I assume you want to use compile-time macros to determine which environment you're on. Maybe you want to determine if you're running on Wine under Linux or something instead of Windows, but in general, your compiler targets a specific environment, and that is either Windows (DOS) or it isn't, but it's rarely (n...
430,479
<p>Suppose I have this in C++:</p> <pre><code>void test(int &amp;i, int &amp;j) { ++i; ++j; } </code></pre> <p>The values are altered inside the function and then used outside. How could I write a code that does the same in Java? I imagine I could return a class that encapsulates both values, but that seems r...
[ { "answer_id": 430488, "author": "JaredPar", "author_id": 23283, "author_profile": "https://Stackoverflow.com/users/23283", "pm_score": 4, "selected": false, "text": "<p>Java has no equivalent of C++ references. The only way to get this to work is to encapsulate the values in another cl...
2009/01/10
[ "https://Stackoverflow.com/questions/430479", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Suppose I have this in C++: ``` void test(int &i, int &j) { ++i; ++j; } ``` The values are altered inside the function and then used outside. How could I write a code that does the same in Java? I imagine I could return a class that encapsulates both values, but that seems really cumbersome.
Java has no equivalent of C++ references. The only way to get this to work is to encapsulate the values in another class and swap the values within the class. Here is a lengthy discussion on the issue: <https://jonskeet.uk/java/passing.html>
430,485
<h2>The issue</h2> <p>I have a <code>&lt;div&gt;</code> on a page which is initially hidden with a <code>visibility: hidden; position: absolute</code>. The issue is that if a <code>&lt;div&gt;</code> hidden this way contains a table which uses <code>border-collapse: collapse</code> and has a border set on it cells, th...
[ { "answer_id": 430702, "author": "buti-oxa", "author_id": 2515, "author_profile": "https://Stackoverflow.com/users/2515", "pm_score": 0, "selected": false, "text": "<p>On your possible workaround: Since you want visibility:hidden and not display:none I assume that it is important that th...
2009/01/10
[ "https://Stackoverflow.com/questions/430485", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5295/" ]
The issue --------- I have a `<div>` on a page which is initially hidden with a `visibility: hidden; position: absolute`. The issue is that if a `<div>` hidden this way contains a table which uses `border-collapse: collapse` and has a border set on it cells, that border still shows "through" the hidden `<div>` on IE. ...
The solution I found consists in adding a top/left to move the rendering off-screen, which shields us against IE bugs of this sort. In the above example, this means that you would define the CSS for the `hide` class as: ``` .hide { visibility: hidden; position: absolute; top: -10000px; left: -10000px; ...
430,525
<p>I've looked all over the <a href="http://haxe.org/" rel="nofollow noreferrer">Haxe</a> Flash Command-line compiler website but was unable to find any detailed <strong>documentation of the <a href="http://haxe.org/doc/start/flash" rel="nofollow noreferrer">HXML files</a></strong> <em>(scroll down to the "Changing SWF...
[ { "answer_id": 430939, "author": "artificialidiot", "author_id": 7988, "author_profile": "https://Stackoverflow.com/users/7988", "pm_score": 4, "selected": true, "text": "<p>Have you tried:</p>\n\n<pre><code>haxe --help\n</code></pre>\n\n<p>.hxml files are just a convenient way to pass c...
2009/01/10
[ "https://Stackoverflow.com/questions/430525", "https://Stackoverflow.com", "https://Stackoverflow.com/users/41021/" ]
I've looked all over the [Haxe](http://haxe.org/) Flash Command-line compiler website but was unable to find any detailed **documentation of the [HXML files](http://haxe.org/doc/start/flash)** *(scroll down to the "Changing SWF properties" section)* which describe the compile. Anybody know of a reference [source?](htt...
Have you tried: ``` haxe --help ``` .hxml files are just a convenient way to pass commandline parameters as far as I know.
430,538
<p>I'm trying to set the editing style property of a UITableViewCell in a Cocoa Touch (iPhone) app. </p> <p>For an example of what this looks like, check out the Contacts app, where you can see the little green plus sign to the left of some of the cells. </p> <p>The UITableViewCell inspector in Interface Builder has ...
[ { "answer_id": 430558, "author": "Frank Schmitt", "author_id": 27951, "author_profile": "https://Stackoverflow.com/users/27951", "pm_score": 6, "selected": true, "text": "<p>It is indeed a method in the UITableViewDelegate:</p>\n\n<pre><code>- (UITableViewCellEditingStyle)tableView:(UITa...
2009/01/10
[ "https://Stackoverflow.com/questions/430538", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27951/" ]
I'm trying to set the editing style property of a UITableViewCell in a Cocoa Touch (iPhone) app. For an example of what this looks like, check out the Contacts app, where you can see the little green plus sign to the left of some of the cells. The UITableViewCell inspector in Interface Builder has an editing style ...
It is indeed a method in the UITableViewDelegate: ``` - (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath ``` Now I get a row of green plus signs!
430,548
<p>Here is my code:</p> <pre><code>records_hash = records[:id].inject({}) { |result,h| if result.has_key?(h) result[h] += 1 else result[h] = 1 end result } @test2 = records_hash.each{|key,value| puts "#{key} is #{value}"} </code></pre> <p>My output should look like this:</p> <pre><code>bozo is 3 bub...
[ { "answer_id": 430552, "author": "Matt Haley", "author_id": 14142, "author_profile": "https://Stackoverflow.com/users/14142", "pm_score": 1, "selected": false, "text": "<p>The problem is, <code>puts</code> returns nil.</p>\n\n<p>What you want to do is:</p>\n\n<pre><code>@test2 = \"\"\n@t...
2009/01/10
[ "https://Stackoverflow.com/questions/430548", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32154/" ]
Here is my code: ``` records_hash = records[:id].inject({}) { |result,h| if result.has_key?(h) result[h] += 1 else result[h] = 1 end result } @test2 = records_hash.each{|key,value| puts "#{key} is #{value}"} ``` My output should look like this: ``` bozo is 3 bubba is 4 bonker is 5 ``` But it rend...
Your problem is that you are using the each method to build your string. What you want is the map method. each method returns the hash and map returns the value of the block. You want something like this: ``` @test2 = records_hash.map { |k,v| "#{k} is #{v}" } ``` Also, you shouldn't be building view code like this,...
430,573
<p>I have an ASP.NET webforms application with a Menu control. How does one hide a particular menu item via code? I've seen a few articles pointing out how to do it with ASP.Net membership/roles-based security, but this particular use case has nothing to do with that. I simply need a way to programmatically remove a me...
[ { "answer_id": 430578, "author": "jwalkerjr", "author_id": 689, "author_profile": "https://Stackoverflow.com/users/689", "pm_score": 4, "selected": true, "text": "<p>Doh! Ok, I figured it out. The correct syntax is (VB.Net):</p>\n\n<pre><code>mnuMyMenu.Items.Remove(mnuMyMenu.Items(1))\n<...
2009/01/10
[ "https://Stackoverflow.com/questions/430573", "https://Stackoverflow.com", "https://Stackoverflow.com/users/689/" ]
I have an ASP.NET webforms application with a Menu control. How does one hide a particular menu item via code? I've seen a few articles pointing out how to do it with ASP.Net membership/roles-based security, but this particular use case has nothing to do with that. I simply need a way to programmatically remove a menu ...
Doh! Ok, I figured it out. The correct syntax is (VB.Net): ``` mnuMyMenu.Items.Remove(mnuMyMenu.Items(1)) ```
430,582
<p>I am building an application, where I have this little survey module, which sends out a simple sms to the phone number I give and has to collect the response(if the user fires it) and show it to me. I am using to django build my project. I have tried django-sms google code project, but I couldn't post messages back ...
[ { "answer_id": 430588, "author": "bchhun", "author_id": 48500, "author_profile": "https://Stackoverflow.com/users/48500", "pm_score": 2, "selected": false, "text": "<p>take a look at <a href=\"http://code.google.com/p/django-sms/\" rel=\"nofollow noreferrer\">django-sms</a></p>\n" }, ...
2009/01/10
[ "https://Stackoverflow.com/questions/430582", "https://Stackoverflow.com", "https://Stackoverflow.com/users/45629/" ]
I am building an application, where I have this little survey module, which sends out a simple sms to the phone number I give and has to collect the response(if the user fires it) and show it to me. I am using to django build my project. I have tried django-sms google code project, but I couldn't post messages back fro...
Hi my name is Jarod and I work for Twilio.com so I am a little biased. But with that said, it is super easy to send an SMS from your Python web application using the [Twilio Rest Api](https://www.twilio.com/docs/api/rest/sending-messages?utm_source=stack_overflow&utm_medium=jan2014&utm_campaign=stackathon). Here is a s...
430,590
<p>I asked about getting iTextSharp to render a PDF from HTML and a CSS sheet before <a href="https://stackoverflow.com/questions/430280/render-pdf-in-itextsharp-from-html-with-css">here</a> but it seems like that may not be possible... So I guess I will have to try something else.</p> <p>Is there an open source .NET...
[ { "answer_id": 430596, "author": "Norman Ramsey", "author_id": 41661, "author_profile": "https://Stackoverflow.com/users/41661", "pm_score": 5, "selected": true, "text": "<p>I've always used it on the command line and not as a library, but <a href=\"https://www.msweet.org/htmldoc/\" rel=...
2009/01/10
[ "https://Stackoverflow.com/questions/430590", "https://Stackoverflow.com", "https://Stackoverflow.com/users/194/" ]
I asked about getting iTextSharp to render a PDF from HTML and a CSS sheet before [here](https://stackoverflow.com/questions/430280/render-pdf-in-itextsharp-from-html-with-css) but it seems like that may not be possible... So I guess I will have to try something else. Is there an open source .NET/C# library out there ...
I've always used it on the command line and not as a library, but [HTMLDOC](https://www.msweet.org/htmldoc/) gives me excellent results, and it handles at least *some* CSS (I couldn't easily see how much). Here's a sample command line ``` htmldoc --webpage -t pdf --size letter --fontsize 10pt index.html > index.pdf ...
430,592
<p>I have </p> <pre><code>class Cab(models.Model): name = models.CharField( max_length=20 ) descr = models.CharField( max_length=2000 ) class Cab_Admin(admin.ModelAdmin): ordering = ('name',) list_display = ('name','descr', ) # what to write here to make descr using TextArea? admin.site.regi...
[ { "answer_id": 430620, "author": "mipadi", "author_id": 28804, "author_profile": "https://Stackoverflow.com/users/28804", "pm_score": 3, "selected": false, "text": "<p>Instead of a <code>models.CharField</code>, use a <code>models.TextField</code> for <code>descr</code>.</p>\n" }, { ...
2009/01/10
[ "https://Stackoverflow.com/questions/430592", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21152/" ]
I have ``` class Cab(models.Model): name = models.CharField( max_length=20 ) descr = models.CharField( max_length=2000 ) class Cab_Admin(admin.ModelAdmin): ordering = ('name',) list_display = ('name','descr', ) # what to write here to make descr using TextArea? admin.site.register( Cab, Cab...
You will have to create a `forms.ModelForm` that will describe how you want the `descr` field to be displayed, and then tell `admin.ModelAdmin` to use that form. For example: ``` from django import forms class CabModelForm( forms.ModelForm ): descr = forms.CharField( widget=forms.Textarea ) class Meta: ...
430,598
<p>I have a small class that displays an alert via Javascript. I am using this class on a page that checks if the user entered valid zip code. If a valid zip code is not entered, an alert is displayed, and the page is posted back to the same page so they can change it. If they enter a valid zip code, they are redirecte...
[ { "answer_id": 430604, "author": "Robin Rodricks", "author_id": 41021, "author_profile": "https://Stackoverflow.com/users/41021", "pm_score": 0, "selected": false, "text": "<p><a href=\"http://www.codeproject.com/KB/cs/OpenTheme.aspx\" rel=\"nofollow noreferrer\">OpenTheme</a> is too fan...
2009/01/10
[ "https://Stackoverflow.com/questions/430598", "https://Stackoverflow.com", "https://Stackoverflow.com/users/52589/" ]
I have a small class that displays an alert via Javascript. I am using this class on a page that checks if the user entered valid zip code. If a valid zip code is not entered, an alert is displayed, and the page is posted back to the same page so they can change it. If they enter a valid zip code, they are redirected t...
**[DockPanel Suite!](http://sourceforge.net/projects/dockpanelsuite/)** Its an open-source **docking library** for .NET Windows Forms development which **mimics Visual Studio .NET**.
430,599
<p>I am struggling with getting this encryption decryption to work right. I am using <a href="http://www.chaosink.co.uk/files/code/encryptionutils.zip" rel="nofollow noreferrer">this</a> class provided by Wolfwyrd and <a href="https://stackoverflow.com/questions/359342/an-effective-method-for-encrypting-a-license-file"...
[ { "answer_id": 463390, "author": "Rasmus Faber", "author_id": 5542, "author_profile": "https://Stackoverflow.com/users/5542", "pm_score": 1, "selected": false, "text": "<p>Try changing the implementation of GetRSAFromSnkBytes(byte[]) in Wolfwyrd's code to:</p>\n\n<pre><code>private stati...
2009/01/10
[ "https://Stackoverflow.com/questions/430599", "https://Stackoverflow.com", "https://Stackoverflow.com/users/53619/" ]
I am struggling with getting this encryption decryption to work right. I am using [this](http://www.chaosink.co.uk/files/code/encryptionutils.zip) class provided by Wolfwyrd and [this](https://stackoverflow.com/questions/359342/an-effective-method-for-encrypting-a-license-file) instructions. Below is the code: ``` RS...
Thank you both for your reply. I ended up just creating a private/public key pair and using that to sign the document, the public key going with the application. If I had seen this early enough I might have used it, but I am sure someone else will find it useful. Thanks again.
430,602
<p>I have a PHP script that pushes the headers to allow a file to download. This script works fine when it called via a hyperlink or through the browser using link. This is how it looks like:</p> <pre><code>&lt;a href="download.php?file=test.mp3&amp;properFilename=Testing File"&gt;Download&lt;/a&gt; </code></pre> <p>...
[ { "answer_id": 430608, "author": "Christian C. Salvadó", "author_id": 5445, "author_profile": "https://Stackoverflow.com/users/5445", "pm_score": 4, "selected": true, "text": "<p>I think that the action url it's been urlencoded, and the hard-coded GET parameters are not sent.</p>\n\n<p>Y...
2009/01/10
[ "https://Stackoverflow.com/questions/430602", "https://Stackoverflow.com", "https://Stackoverflow.com/users/51649/" ]
I have a PHP script that pushes the headers to allow a file to download. This script works fine when it called via a hyperlink or through the browser using link. This is how it looks like: ``` <a href="download.php?file=test.mp3&properFilename=Testing File">Download</a> ``` I want this to be a button (sbumit) instea...
I think that the action url it's been urlencoded, and the hard-coded GET parameters are not sent. You can try to set the action url simply to download.php and have two hidden fields containing the "file" and "properFilename" parameters, like this: ``` <form action="download.php" method="GET"> <input type="submit" v...
430,614
<p>How can I get the url from a running instance of firefox using .NET 2.0 windows/console app? C# or VB codes will do.</p> <p>Thanks!</p>
[ { "answer_id": 430625, "author": "Jeff Martin", "author_id": 13100, "author_profile": "https://Stackoverflow.com/users/13100", "pm_score": 1, "selected": false, "text": "<p>You may want to check into the source code of WatiN. Their next version is open source and supports firefox, so I ...
2009/01/10
[ "https://Stackoverflow.com/questions/430614", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18413/" ]
How can I get the url from a running instance of firefox using .NET 2.0 windows/console app? C# or VB codes will do. Thanks!
Building on Rob Kennedy's answer and using [NDde](http://www.codeplex.com/ndde) ``` using NDde.Client; class Test { public static string GetFirefoxURL() { DdeClient dde = new DdeClient("Firefox", "WWW_GetWindowInfo"); dde.Connect(); string url = dde.Request("URL", i...
430,648
<p>Lets say I have 5 pages: A, B, C, D, and E. I also have a horizontal menu, and each item has a light gray background.</p> <p>Each menu item has a:hover that gives it a medium-gray background, but I want the active page to have a black background, so I define</p> <pre><code>#black { background-color: #000; } </...
[ { "answer_id": 430660, "author": "dylanfm", "author_id": 38795, "author_profile": "https://Stackoverflow.com/users/38795", "pm_score": 2, "selected": false, "text": "<p>You can assign a class or id to the <code>&lt;body&gt;</code> element relating to what the current page is. Then style ...
2009/01/10
[ "https://Stackoverflow.com/questions/430648", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29595/" ]
Lets say I have 5 pages: A, B, C, D, and E. I also have a horizontal menu, and each item has a light gray background. Each menu item has a:hover that gives it a medium-gray background, but I want the active page to have a black background, so I define ``` #black { background-color: #000; } ``` Now when the user...
A suggestion; don't define what your style "is", define what your style "does". Don't call it #black, instead call it .current. Another thing to note is that ID's are meant for identifying unique elements (#header, #footer, #main, #sidebar, #navbar, etc.). Defining a repeatable item as current should be done with a cl...
430,672
<p>I need a smart pointer for my project which can be send to several methods as parameter. I have checked <em>auto_ptr</em> and <em>shared_ptr</em> from boost. But IMO, that is not suitable for my requirements. Following are my findings</p> <p>auto_ptr : When passed to another method, ownership will be transferred an...
[ { "answer_id": 430683, "author": "Ed Carrel", "author_id": 50013, "author_profile": "https://Stackoverflow.com/users/50013", "pm_score": 1, "selected": false, "text": "<p>To answer your first question, the best assurance you can get that this is correct is to implement a test harness aro...
2009/01/10
[ "https://Stackoverflow.com/questions/430672", "https://Stackoverflow.com", "https://Stackoverflow.com/users/50419/" ]
I need a smart pointer for my project which can be send to several methods as parameter. I have checked *auto\_ptr* and *shared\_ptr* from boost. But IMO, that is not suitable for my requirements. Following are my findings auto\_ptr : When passed to another method, ownership will be transferred and underlying pointer ...
Please use [boost::scoped\_ptr<>](http://www.boost.org/doc/libs/1_36_0/libs/smart_ptr/scoped_ptr.htm) as suggested by Martin York, because it: * Does exactly what you want (it's a noncopyable pointer) * Has no overhead above that of a standard C pointer * Has been carefully crafted by super-intelligent C++ wizards to ...
430,681
<p>Reviewing Conery's storefront, and I dont understand why he used Linqs auto-generated classes (ie Order class) and then he has another Order class defined that is not a partial class. WHen using repository pattern should one manually create the classes, and disregard Datacontext altogether? </p>
[ { "answer_id": 430685, "author": "Chad Moran", "author_id": 25416, "author_profile": "https://Stackoverflow.com/users/25416", "pm_score": 2, "selected": false, "text": "<p>He said in one of his recent videos he doesn't like the way LINQ to SQL does mapping. I agree though I think it is ...
2009/01/10
[ "https://Stackoverflow.com/questions/430681", "https://Stackoverflow.com", "https://Stackoverflow.com/users/49632/" ]
Reviewing Conery's storefront, and I dont understand why he used Linqs auto-generated classes (ie Order class) and then he has another Order class defined that is not a partial class. WHen using repository pattern should one manually create the classes, and disregard Datacontext altogether?
If you don't decouple your front end from the linq classes using an intermediary class, you can't control with the data context gets garbage collected. Typically with data context types of instances you want to rid of them as soon as you're done using them. Here's how you might want to do this with the linq to sql cont...
430,687
<p>Does anyone know of a windows build of mod_throttle for Apache 2.2 or lower?</p> <p>Or perhaps another means by which to throttle bandwidth. I need to throttle as low as 64k for a local speed test demonstration</p> <p>Preferably Apache rather than a browser plug-in too.</p> <p>Thanks!</p>
[ { "answer_id": 430685, "author": "Chad Moran", "author_id": 25416, "author_profile": "https://Stackoverflow.com/users/25416", "pm_score": 2, "selected": false, "text": "<p>He said in one of his recent videos he doesn't like the way LINQ to SQL does mapping. I agree though I think it is ...
2009/01/10
[ "https://Stackoverflow.com/questions/430687", "https://Stackoverflow.com", "https://Stackoverflow.com/users/36076/" ]
Does anyone know of a windows build of mod\_throttle for Apache 2.2 or lower? Or perhaps another means by which to throttle bandwidth. I need to throttle as low as 64k for a local speed test demonstration Preferably Apache rather than a browser plug-in too. Thanks!
If you don't decouple your front end from the linq classes using an intermediary class, you can't control with the data context gets garbage collected. Typically with data context types of instances you want to rid of them as soon as you're done using them. Here's how you might want to do this with the linq to sql cont...
430,689
<p>I have a tough one here, but I think the benefit will be great...</p> <p>I'm using the following CSS hack with PHP. The U variable in the file below is a constant, previously defined (before I include this file) as the URL such as <a href="http://example.com/" rel="nofollow noreferrer">http://example.com/</a>. The ...
[ { "answer_id": 430960, "author": "runeh", "author_id": 2906, "author_profile": "https://Stackoverflow.com/users/2906", "pm_score": 1, "selected": false, "text": "<p>I'm going to assume you've tried using the same stylesheets for webkit/ff/opera allready, and that this is the last resort ...
2009/01/10
[ "https://Stackoverflow.com/questions/430689", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I have a tough one here, but I think the benefit will be great... I'm using the following CSS hack with PHP. The U variable in the file below is a constant, previously defined (before I include this file) as the URL such as <http://example.com/>. The P constant variable is defined as the physical file path like /var/w...
I'm going to assume you've tried using the same stylesheets for webkit/ff/opera allready, and that this is the last resort because you're doing something strange? Anyway, Opera does indeed support `@import`. (It has to, @import is used in [6.79% of all stylesheets](http://dev.opera.com/articles/view/mama-css-syntax/#a...
430,704
<p>I was asking a related question but messed the title up and no-one would understand it. Since I am able now to ask the question more precisely, I decided to reformulate it in a new question and close the old one. Sorry for that.</p> <p>So what I want to do is passing data (my custom user's nickname as stored in the...
[ { "answer_id": 430765, "author": "keeney", "author_id": 48046, "author_profile": "https://Stackoverflow.com/users/48046", "pm_score": 3, "selected": false, "text": "<p>Can you grab this using something like:</p>\n\n<pre><code>HttpContext currentContext = HttpContext.Current;\nstring user...
2009/01/10
[ "https://Stackoverflow.com/questions/430704", "https://Stackoverflow.com", "https://Stackoverflow.com/users/53102/" ]
I was asking a related question but messed the title up and no-one would understand it. Since I am able now to ask the question more precisely, I decided to reformulate it in a new question and close the old one. Sorry for that. So what I want to do is passing data (my custom user's nickname as stored in the db) to th...
My guess would be that the Controller's base constructor is not filling in the User, but that it is only known later when the ControllerContext is set for the Controller. You should check this in the documentation about the lifecycle of an MVC application, (the one [here](http://www.techtribe.com/viewBlogEntry.html?blo...
430,713
<p>I am creating a small console app that needs a progress bar. Something like...</p> <pre><code>Conversion: 175/348 Seconds |========== | 50% </code></pre> <p>My question is, how do you erase characters already printed to the console? When I reach the 51st percentage, I have to erase this line from the c...
[ { "answer_id": 430715, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 0, "selected": false, "text": "<p>to erase a previously printed character, I print a backspace after it:\nprint \"a\"\nprint \"\\b\"</p>\n\n<p>will print <em...
2009/01/10
[ "https://Stackoverflow.com/questions/430713", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15595/" ]
I am creating a small console app that needs a progress bar. Something like... ``` Conversion: 175/348 Seconds |========== | 50% ``` My question is, how do you erase characters already printed to the console? When I reach the 51st percentage, I have to erase this line from the console and insert a new li...
I don't think you need to apologize for the language choice. PHP is a great language for console applications. Try this out: ``` <?php for( $i=0;$i<10;$i++){ print "$i \r"; sleep(1); } ?> ``` The "\r" will overwrite the line with the new text. To make a new line you can just use "\n", but I'm guessing you alrea...
430,736
<p>My server is in Dallas. I'm in New York City.. and both PHP and MySQL have configuration variables for setting the timezone.</p> <p>How do I get them all to work together? What dates should I store in MySQL? How do I get PHP to handle changing the date based on the user's preference?</p> <p>Bear in mind: I don...
[ { "answer_id": 430740, "author": "Soviut", "author_id": 46914, "author_profile": "https://Stackoverflow.com/users/46914", "pm_score": 0, "selected": false, "text": "<p>Record your dates in GMT (zero offset) and then calculate the offset based on the local timezone (EST is +6, for example...
2009/01/10
[ "https://Stackoverflow.com/questions/430736", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
My server is in Dallas. I'm in New York City.. and both PHP and MySQL have configuration variables for setting the timezone. How do I get them all to work together? What dates should I store in MySQL? How do I get PHP to handle changing the date based on the user's preference? Bear in mind: I don't think I'm ever hav...
Use Unix Time everywhere. It's using UTC so it's the same for every timezone. Methods for dates usually convert to it and back from it using timezone information they have, so you would have yourself a correct time. Alternatively you could use Unix Time only to transfer time from one computer to another (like from DB ...
430,751
<p>I have a "description" field indexed in Lucene.This field contains a book's description. How do i achieve "All of these words" functionality on this field using BooleanQuery class? For example if a user types in "top selling book" then it should return books which have all of these words in its description.</p> <p>...
[ { "answer_id": 430776, "author": "Peter Becker", "author_id": 19820, "author_profile": "https://Stackoverflow.com/users/19820", "pm_score": 0, "selected": false, "text": "<p>I believe if you add all query parts (one per term) via</p>\n\n<pre><code>BooleanQuery.add(Query, BooleanClause.Oc...
2009/01/10
[ "https://Stackoverflow.com/questions/430751", "https://Stackoverflow.com", "https://Stackoverflow.com/users/40907/" ]
I have a "description" field indexed in Lucene.This field contains a book's description. How do i achieve "All of these words" functionality on this field using BooleanQuery class? For example if a user types in "top selling book" then it should return books which have all of these words in its description. Thanks!
There are two pieces to get this to work: 1. You need the incoming documents to be analysed properly, so that individual words are tokenised and indexed separately 2. The user query needs to be tokenised, and the tokens combined with the `AND` operator. For #1, there are a number of Analyzers and Tokenizers that [com...
430,755
<p>I've been working with web start for a couple years now and have experience with signing the jars and what not. I am taking my first attempt at deploying a RCP app with web start and though I have in fact signed all of the jars with the same certificate I keep getting this error: 'jar resources in jnlp are not signe...
[ { "answer_id": 430761, "author": "asalamon74", "author_id": 21348, "author_profile": "https://Stackoverflow.com/users/21348", "pm_score": 5, "selected": true, "text": "<p>When I had similar problems after checking the jars it turned out that some 3rd party jar was signed by someone else....
2009/01/10
[ "https://Stackoverflow.com/questions/430755", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27657/" ]
I've been working with web start for a couple years now and have experience with signing the jars and what not. I am taking my first attempt at deploying a RCP app with web start and though I have in fact signed all of the jars with the same certificate I keep getting this error: 'jar resources in jnlp are not signed b...
When I had similar problems after checking the jars it turned out that some 3rd party jar was signed by someone else. You should create a separate jnlp file for the jars signed by the other certificate and read this jnlp from your jnlp file: ``` <resources> ... <extension name="other" href="other.jnlp"/> </resou...
430,759
<p>I would like to be able to match a string literal with the option of escaped quotations. For instance, I'd like to be able to search "this is a 'test with escaped\' values' ok" and have it properly recognize the backslash as an escape character. I've tried solutions like the following:</p> <pre><code>import re rege...
[ { "answer_id": 430763, "author": "cletus", "author_id": 18393, "author_profile": "https://Stackoverflow.com/users/18393", "pm_score": 1, "selected": false, "text": "<p>If I understand what you're saying (and I'm not sure I do) you want to find the quoted string within your string ignorin...
2009/01/10
[ "https://Stackoverflow.com/questions/430759", "https://Stackoverflow.com", "https://Stackoverflow.com/users/49701/" ]
I would like to be able to match a string literal with the option of escaped quotations. For instance, I'd like to be able to search "this is a 'test with escaped\' values' ok" and have it properly recognize the backslash as an escape character. I've tried solutions like the following: ``` import re regexc = re.compil...
I think this will work: ``` import re regexc = re.compile(r"(?:^|[^\\])'(([^\\']|\\'|\\\\)*)'") def check(test, base, target): match = regexc.search(base) assert match is not None, test+": regex didn't match for "+base assert match.group(1) == target, test+": "+target+" not found in "+base print "test...
430,771
<p>I'm currently trying to extend a friend's OCaml program. It's a huge collection of functions needed for some data analysis.. Since I'm not really an OCaml crack I'm currently stuck on a (for me) strange List implementation:</p> <pre><code>type 'a cell = Nil | Cons of ('a * 'a llist) and 'a llist = (unit -&gt; '...
[ { "answer_id": 430887, "author": "starblue", "author_id": 49246, "author_profile": "https://Stackoverflow.com/users/49246", "pm_score": 4, "selected": true, "text": "<pre><code>let rec append l1 l2 = \n match l1 () with\n Nil -&gt; l2 | \n (Cons (a, l)) -&gt; fun () -&gt...
2009/01/10
[ "https://Stackoverflow.com/questions/430771", "https://Stackoverflow.com", "https://Stackoverflow.com/users/43960/" ]
I'm currently trying to extend a friend's OCaml program. It's a huge collection of functions needed for some data analysis.. Since I'm not really an OCaml crack I'm currently stuck on a (for me) strange List implementation: ``` type 'a cell = Nil | Cons of ('a * 'a llist) and 'a llist = (unit -> 'a cell);; ``` I...
``` let rec append l1 l2 = match l1 () with Nil -> l2 | (Cons (a, l)) -> fun () -> (Cons (a, append l l2));; let rec map f l = fun () -> match l () with Nil -> Nil | (Cons (a, r)) -> fun () -> (Cons (f a, map f r));; ``` The basic idea of this implementatio...
430,811
<p>A friend asked me last week how to enumerate or list all variables within a program/function/etc. for the purposes of debugging (essentially getting a snapshot of everything so you can see what variables are set to, or if they are set at all). I looked around a bit and found a relatively good way for Python:</p> <p...
[ { "answer_id": 430819, "author": "Marc Gravell", "author_id": 23354, "author_profile": "https://Stackoverflow.com/users/23354", "pm_score": 2, "selected": false, "text": "<p>First, I'd simply use a debugger ;-p\nVisual Studio, for example, has \"Locals\" and \"Watch\" windows that will s...
2009/01/10
[ "https://Stackoverflow.com/questions/430811", "https://Stackoverflow.com", "https://Stackoverflow.com/users/31056/" ]
A friend asked me last week how to enumerate or list all variables within a program/function/etc. for the purposes of debugging (essentially getting a snapshot of everything so you can see what variables are set to, or if they are set at all). I looked around a bit and found a relatively good way for Python: ``` #!/u...
In python, using locals which returns a dictionary containing all the local bindings, thus, avoiding eval: ``` >>> foo1 = "Hello world" >>> foo2 = "bar" >>> foo3 = {"1":"a", ... "2":"b"} >>> foo4 = "1+1" >>> import pprint >>> pprint.pprint(locals()) {'__builtins__': <module '__builtin__' (built-in)>, '__doc_...
430,839
<p>I'm trying hard to understand when and what I must relase in Cocoa Touch as it doesn't have garbage collection.</p> <p>This code block is from apples iphone sample PeriodicElements and they release anElement and rawElementArray but not thePath, firstLetter, existingArray and tempArray?</p> <p>I would have thought ...
[ { "answer_id": 430846, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 2, "selected": false, "text": "<p>They create <code>rawElementsArray</code> by sending <code>+alloc</code> to the class, therefore this object is owned by th...
2009/01/10
[ "https://Stackoverflow.com/questions/430839", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I'm trying hard to understand when and what I must relase in Cocoa Touch as it doesn't have garbage collection. This code block is from apples iphone sample PeriodicElements and they release anElement and rawElementArray but not thePath, firstLetter, existingArray and tempArray? I would have thought that at least tem...
They create `rawElementsArray` by sending `+alloc` to the class, therefore this object is owned by the code in the sample above and must be released. Similarly with `anElement`. Note that `thePath` and `tempArray` are not created by sending `+alloc`, `+new` or `-copy` messages, therefore the calling code is not respons...
430,879
<p>I have two ASP.NET web application. One is responsible for processing some info and <strong>writing to a log file</strong>, and the other application is reponsible for <strong>reading the log</strong> file and displays the information based on user request.</p> <p>Here's my code for the Writer</p> <pre><code>publi...
[ { "answer_id": 430885, "author": "Tom Anderson", "author_id": 13502, "author_profile": "https://Stackoverflow.com/users/13502", "pm_score": 1, "selected": false, "text": "<p>Doing this in a web based environment, you are going to have a lot of issues with file locks, can you change this ...
2009/01/10
[ "https://Stackoverflow.com/questions/430879", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10629/" ]
I have two ASP.NET web application. One is responsible for processing some info and **writing to a log file**, and the other application is reponsible for **reading the log** file and displays the information based on user request. Here's my code for the Writer ``` public static void WriteLog(String PathToLogFile, St...
Sounds like your trying to implement a basic queue. Why not use a queue that gives you guarenteed availability. You could drop the messages into an MSMQ, then implement a windows service which will read from the queue and push the messages to the DB. If the writting to the DB fails you simply leave the message on the q...
430,899
<p>Anyone can point me to the error please?</p> <p>Note: this is a simplified test case extracted from my real app. Thus the weird usage of 3 entity managers and em1.getTransaction().begin(); em1.clear(); em1.close(); at the end of each section. In real app it happens in different times. HibernateUtil is basically cop...
[ { "answer_id": 431496, "author": "cliff.meyers", "author_id": 41754, "author_profile": "https://Stackoverflow.com/users/41754", "pm_score": 1, "selected": false, "text": "<p>I'd give something like this a try:</p>\n\n<pre><code>EntityTransaction tx1 = em1.getTransaction();\n// make your ...
2009/01/10
[ "https://Stackoverflow.com/questions/430899", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Anyone can point me to the error please? Note: this is a simplified test case extracted from my real app. Thus the weird usage of 3 entity managers and em1.getTransaction().begin(); em1.clear(); em1.close(); at the end of each section. In real app it happens in different times. HibernateUtil is basically copied from t...
I'd give something like this a try: ``` EntityTransaction tx1 = em1.getTransaction(); // make your modifications em1.merge(st1); tx1.commit(); ``` Not sure why you have are beginning a transaction right before you clean up the EntityManager. I don't work with JPA transactions programmatically so this is just an educ...
430,904
<p>is it possible to make nant run a publish on mvc project or a good old web application project<br> and after the publish make nant FTP the files to the web server</p> <p><strong><em>UPDATE:</em></strong> found the solution to the ftp problem<br> <a href="http://www.spinthemoose.com/~ftptask/" rel="nofollow noreferr...
[ { "answer_id": 430917, "author": "Paco", "author_id": 13376, "author_profile": "https://Stackoverflow.com/users/13376", "pm_score": 2, "selected": false, "text": "<p>There is a <a href=\"http://www.spinthemoose.com/~ftptask/\" rel=\"nofollow noreferrer\" title=\"FTP task\">Ftp Task</a> f...
2009/01/10
[ "https://Stackoverflow.com/questions/430904", "https://Stackoverflow.com", "https://Stackoverflow.com/users/31296/" ]
is it possible to make nant run a publish on mvc project or a good old web application project and after the publish make nant FTP the files to the web server ***UPDATE:*** found the solution to the ftp problem [Nant ftp task](http://www.spinthemoose.com/~ftptask/) thanks Paco what i mean by publich is there...
The visual studio publish command rebuilds your solution and then copies the files in the solution directory to a new directory. I use the following target to do almost the same: ``` <target name="copyToPublish"> <delete dir="${dir.publish}" /> <mkdir dir="${dir.publish}" /> <mkdir dir="${dir.publish}\wwwr...
430,912
<p>I am developing a site in vertigoserver. Now I need to test the webpage in webserver.</p> <p>I am using the webserver Host-Europe VirtualServer 3.0.</p> <ol> <li>Now what are the steps I need to upload the PHP pages?</li> <li>What is the software needed to upload MySQL queries?</li> <li>Are there any tutorials or ...
[ { "answer_id": 430920, "author": "Paul Dixon", "author_id": 6521, "author_profile": "https://Stackoverflow.com/users/6521", "pm_score": 4, "selected": true, "text": "<p>This seems like basic stuff, but I'll give you some pointers!</p>\n\n<p>Upload the pages with an FTP client or similar....
2009/01/10
[ "https://Stackoverflow.com/questions/430912", "https://Stackoverflow.com", "https://Stackoverflow.com/users/44984/" ]
I am developing a site in vertigoserver. Now I need to test the webpage in webserver. I am using the webserver Host-Europe VirtualServer 3.0. 1. Now what are the steps I need to upload the PHP pages? 2. What is the software needed to upload MySQL queries? 3. Are there any tutorials or suggestions?
This seems like basic stuff, but I'll give you some pointers! Upload the pages with an FTP client or similar. If you have shell access, tools like [rsync](http://samba.anu.edu.au/rsync/) can make this easier. You've probably got some sort of web based front end for MySQL like [phpMyAdmin](http://www.phpmyadmin.net/ho...
430,922
<p>What is a good way to calculate difference (in a sense what should be added and deleted from one table to get another) between tables in MySQL?</p>
[ { "answer_id": 430923, "author": "vava", "author_id": 6258, "author_profile": "https://Stackoverflow.com/users/6258", "pm_score": 1, "selected": false, "text": "<pre><code>SELECT DISTINCT id FROM a WHERE NOT EXISTS (SELECT * FROM b WHERE a.id = b.id);\nSELECT DISTINCT id FROM b WHERE NOT...
2009/01/10
[ "https://Stackoverflow.com/questions/430922", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6258/" ]
What is a good way to calculate difference (in a sense what should be added and deleted from one table to get another) between tables in MySQL?
You can also use a left outer join (the first tells you where a row exists in table a and not b, the second vice-versa): ``` SELECT a.id FROM a LEFT JOIN b ON a.id = b.id WHERE b.id IS NULL SELECT b.id FROM b LEFT JOIN a ON b.id = a.id WHERE a.id IS NULL ```
430,927
<p>I usually write C# programs for myself, or just parts of other applications. Now, I have been working on a project that I would like to eventually commercialize and I am interested in the easiest way to deploy a simple application from VS 2008 that will primarily be downloaded and installed. I am not just interest...
[ { "answer_id": 430923, "author": "vava", "author_id": 6258, "author_profile": "https://Stackoverflow.com/users/6258", "pm_score": 1, "selected": false, "text": "<pre><code>SELECT DISTINCT id FROM a WHERE NOT EXISTS (SELECT * FROM b WHERE a.id = b.id);\nSELECT DISTINCT id FROM b WHERE NOT...
2009/01/10
[ "https://Stackoverflow.com/questions/430927", "https://Stackoverflow.com", "https://Stackoverflow.com/users/50859/" ]
I usually write C# programs for myself, or just parts of other applications. Now, I have been working on a project that I would like to eventually commercialize and I am interested in the easiest way to deploy a simple application from VS 2008 that will primarily be downloaded and installed. I am not just interested in...
You can also use a left outer join (the first tells you where a row exists in table a and not b, the second vice-versa): ``` SELECT a.id FROM a LEFT JOIN b ON a.id = b.id WHERE b.id IS NULL SELECT b.id FROM b LEFT JOIN a ON b.id = a.id WHERE a.id IS NULL ```
430,937
<p>I'm currently in the creation of a javascript function library. Mainly for my own use, but you can never be sure if someone else ends up using it in their projects, I'm atleast creating it as if that could happen.<br> Most methods only work if the variables that are passed are of the correct datatype. Now my questio...
[ { "answer_id": 430961, "author": "Thevs", "author_id": 8559, "author_profile": "https://Stackoverflow.com/users/8559", "pm_score": 0, "selected": false, "text": "<p>What's about just to silently convert string to numeric datatype on function startup?</p>\n\n<p>You always can determine th...
2009/01/10
[ "https://Stackoverflow.com/questions/430937", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35197/" ]
I'm currently in the creation of a javascript function library. Mainly for my own use, but you can never be sure if someone else ends up using it in their projects, I'm atleast creating it as if that could happen. Most methods only work if the variables that are passed are of the correct datatype. Now my question is...
Some small remarks on type checking - it's actually not that complicated: Use `typeof` to check for primitives and `instanceof` to check for specific object types. Example: Check for strings with ``` typeof x === 'string' ``` or ``` typeof x === 'string' || x instanceof String ``` if you want to include string ...
430,942
<p>Right, I'm trying to get a label with text in it (done already obviously), which scrolls across the screen.</p> <p>The text that is input into the label is done by a UITextField and a UIButton. This updates fine.</p> <p>But I'm trying to get the UILabel to resize accordingly to the amount of text input, so that th...
[ { "answer_id": 431260, "author": "Brad Larson", "author_id": 19679, "author_profile": "https://Stackoverflow.com/users/19679", "pm_score": 4, "selected": true, "text": "<p>I believe something similar to <a href=\"https://stackoverflow.com/questions/419710/how-do-i-pan-the-image-inside-a-...
2009/01/10
[ "https://Stackoverflow.com/questions/430942", "https://Stackoverflow.com", "https://Stackoverflow.com/users/53677/" ]
Right, I'm trying to get a label with text in it (done already obviously), which scrolls across the screen. The text that is input into the label is done by a UITextField and a UIButton. This updates fine. But I'm trying to get the UILabel to resize accordingly to the amount of text input, so that the WHOLE lot of te...
I believe something similar to [the solution for this question](https://stackoverflow.com/questions/419710/how-do-i-pan-the-image-inside-a-uiimageview) would work for this case. You could embed the UILabel in a UIScrollView, with the UIScrollView set to the max size of the label that you want to display on the screen ...
430,956
<p>I am Showing An example of Stored Procedure For Data Transaction using "Linked Server" Between Two System Through Internet</p> <pre><code>Alter Proc [dbo].[usp_Select_TransferingDatasFromServerCheckingforExample] @RserverName varchar(100), ----- Server Name @RUserid Varchar(100), ----- server user id ...
[ { "answer_id": 434154, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 0, "selected": false, "text": "<p>A long shot, but i've encountered a similiar problem a while back, on MSSQL Server 7. It turned out that both system were r...
2009/01/10
[ "https://Stackoverflow.com/questions/430956", "https://Stackoverflow.com", "https://Stackoverflow.com/users/53679/" ]
I am Showing An example of Stored Procedure For Data Transaction using "Linked Server" Between Two System Through Internet ``` Alter Proc [dbo].[usp_Select_TransferingDatasFromServerCheckingforExample] @RserverName varchar(100), ----- Server Name @RUserid Varchar(100), ----- server user id @RPass Varchar(...
I agree with the above posting that it might be a protocol issue but it might need to use Named Pipes as the interface. Or it could be that the user account that the DTC service is runnning under only has local rights and no rights on the network. Use a domain account with sufficient rights on both machines to run DTC...
430,966
<p>I hope this question is not a RTFM one. I am trying to write a Python script that extracts links from a standard HTML webpage (the <code>&lt;link href...</code> tags). I have searched the web for matching regexen and found many different patterns. Is there any agreed, standard regex to match links?</p> <p>Adam</p> ...
[ { "answer_id": 430976, "author": "cletus", "author_id": 18393, "author_profile": "https://Stackoverflow.com/users/18393", "pm_score": 4, "selected": false, "text": "<p>Regexes with HTML get messy. Just use a DOM parser like Beautiful Soup.</p>\n" }, { "answer_id": 430977, "a...
2009/01/10
[ "https://Stackoverflow.com/questions/430966", "https://Stackoverflow.com", "https://Stackoverflow.com/users/51197/" ]
I hope this question is not a RTFM one. I am trying to write a Python script that extracts links from a standard HTML webpage (the `<link href...` tags). I have searched the web for matching regexen and found many different patterns. Is there any agreed, standard regex to match links? Adam **UPDATE:** I am actually l...
As others have suggested, if real-time-like performance isn't necessary, BeautifulSoup is a good solution: ``` import urllib2 from BeautifulSoup import BeautifulSoup html = urllib2.urlopen("http://www.google.com").read() soup = BeautifulSoup(html) all_links = soup.findAll("a") ``` As for the second question, yes, H...
430,990
<p>I have been studying SOAP and WSDL in preparation for implementing a web service. One thing that I have encountered that puzzles me is that some of the URIs that I have seen use a trailing slash such as:</p> <pre><code>http://www.w3.org/some-namespace/ </code></pre> <p>while other examples that I have studied omi...
[ { "answer_id": 430996, "author": "Marc Gravell", "author_id": 23354, "author_profile": "https://Stackoverflow.com/users/23354", "pm_score": 2, "selected": false, "text": "<p>No they aren't the same.</p>\n\n<p>The biggest difference would be in the forming of relative uris from that base;...
2009/01/10
[ "https://Stackoverflow.com/questions/430990", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19674/" ]
I have been studying SOAP and WSDL in preparation for implementing a web service. One thing that I have encountered that puzzles me is that some of the URIs that I have seen use a trailing slash such as: ``` http://www.w3.org/some-namespace/ ``` while other examples that I have studied omit this trailing slash. I re...
Namespace URIs are simply meant as unique identifiers ([here](http://www.w3.org/TR/REC-xml-names/#NSNameComparison)'s a link to the rules for comparison). Use of a URI (versus, say "foo") can be traced back (I believe) to the use of URIs in an XML DOCTYPE. Which is also, I think where the confusion comes regarding the...
431,053
<p>What's the best way to get the rank of the rows in addition to the row data in MYSQL?</p> <p>For instance, say I have a list of students and I want to rank on the GPA. I know I can order by the GPA, but what's the quickest way to have MYSQL return the rank as well in the rowdata I get back?</p>
[ { "answer_id": 431065, "author": "Vinko Vrsalovic", "author_id": 5190, "author_profile": "https://Stackoverflow.com/users/5190", "pm_score": 4, "selected": true, "text": "<p>This will return the rank as <code>rownum</code> </p>\n\n<pre><code>SELECT @rownum := @rownum + 1 rownum, \n ...
2009/01/10
[ "https://Stackoverflow.com/questions/431053", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42914/" ]
What's the best way to get the rank of the rows in addition to the row data in MYSQL? For instance, say I have a list of students and I want to rank on the GPA. I know I can order by the GPA, but what's the quickest way to have MYSQL return the rank as well in the rowdata I get back?
This will return the rank as `rownum` ``` SELECT @rownum := @rownum + 1 rownum, t.* FROM (SELECT @rownum:=0) r, (SELECT * FROM students ORDER BY gpa DESC) t; ```
431,076
<p>I execute the following command and the error occurs:</p> <pre><code>recover database until time '2009-01-09 12:26'; ORA-00283: recovery session canceled due to errors ORA-19907: recovery time or SCN does not belong to recovered incarnation; </code></pre> <p>How can I solve this problem?</p>
[ { "answer_id": 431112, "author": "ChrisA", "author_id": 24867, "author_profile": "https://Stackoverflow.com/users/24867", "pm_score": 1, "selected": false, "text": "<p>There's a suggested action <a href=\"http://ora-19907.ora-code.com/\" rel=\"nofollow noreferrer\">here</a></p>\n\n<p>I'm...
2009/01/10
[ "https://Stackoverflow.com/questions/431076", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I execute the following command and the error occurs: ``` recover database until time '2009-01-09 12:26'; ORA-00283: recovery session canceled due to errors ORA-19907: recovery time or SCN does not belong to recovered incarnation; ``` How can I solve this problem?
There's a suggested action [here](http://ora-19907.ora-code.com/) I'm not an Oracle user, so that's as far as I can go. [Just Googling the code](http://tinyurl.com/8tc45m) found that though.
431,080
<p>Quick one, but thought I'd ask.</p> <p>Is there a better way of getting the column values from a model's column than something like this?</p> <pre><code>Item.count(:all, :group =&gt; 'status').reject! { |i, e| i.blank? }.collect { |i,e| i} </code></pre>
[ { "answer_id": 431109, "author": "sikachu", "author_id": 52035, "author_profile": "https://Stackoverflow.com/users/52035", "pm_score": -1, "selected": false, "text": "<p>Is it the same thing as the following code?</p>\n\n<pre><code>Item.count(:all, :group =&gt; \"status\", :conditions =&...
2009/01/10
[ "https://Stackoverflow.com/questions/431080", "https://Stackoverflow.com", "https://Stackoverflow.com/users/52092/" ]
Quick one, but thought I'd ask. Is there a better way of getting the column values from a model's column than something like this? ``` Item.count(:all, :group => 'status').reject! { |i, e| i.blank? }.collect { |i,e| i} ```
``` Item.find(:all, :select=>:status, :group => 'status', :conditions => "status != ''").collect{|r| r.status} ```
431,082
<p>Using POSIX threads &amp; C++, I have an "Insert operation" which can only be done safely one at a time.</p> <p>If I have multiple threads waiting to insert using pthread_join then spawning a new thread when it finishes. Will they all receive the "thread complete" signal at once and spawn multiple inserts or is it...
[ { "answer_id": 431103, "author": "Timo Metsälä", "author_id": 53672, "author_profile": "https://Stackoverflow.com/users/53672", "pm_score": 2, "selected": false, "text": "<p>According to the Single Unix Specifcation: \"The results of multiple simultaneous calls to pthread_join() specifyi...
2009/01/10
[ "https://Stackoverflow.com/questions/431082", "https://Stackoverflow.com", "https://Stackoverflow.com/users/51467/" ]
Using POSIX threads & C++, I have an "Insert operation" which can only be done safely one at a time. If I have multiple threads waiting to insert using pthread\_join then spawning a new thread when it finishes. Will they all receive the "thread complete" signal at once and spawn multiple inserts or is it safe to assu...
From [opengroup.org on pthread\_join](http://opengroup.org/onlinepubs/007908799/xsh/pthread_join.html): > > The results of multiple simultaneous calls to pthread\_join() specifying the same target thread are undefined. > > > So, you really should not have several threads joining your previous insertThread. First...
431,091
<p>It's possible to declare variables with the below structure in C++</p> <pre><code>private: public: protected: float bla1; float bla2; float bla3; </code></pre> <p>Is there an equivalent in C#? It seems rather tedious having to repeat yourself;</p> <pre><code>protected float bla1; protected float bla2;...
[ { "answer_id": 431094, "author": "mmx", "author_id": 33708, "author_profile": "https://Stackoverflow.com/users/33708", "pm_score": 4, "selected": true, "text": "<p>No there isn't such a thing. In fact, it's designed to be like that to make code more readable. This applies to both C# and ...
2009/01/10
[ "https://Stackoverflow.com/questions/431091", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17540/" ]
It's possible to declare variables with the below structure in C++ ``` private: public: protected: float bla1; float bla2; float bla3; ``` Is there an equivalent in C#? It seems rather tedious having to repeat yourself; ``` protected float bla1; protected float bla2; protected float bla3; ```
No there isn't such a thing. In fact, it's designed to be like that to make code more readable. This applies to both C# and Java.
431,123
<p>can some one help me with the following JSF dataTable? here I am getting data from database table and I used dataTable binding, but I don't know why it displays the rows 3 times in the screen, but if I remove the binding then it displays only one time.</p> <hr> <pre><code>&lt;h:dataTable binding="#{threadControlle...
[ { "answer_id": 434487, "author": "Warrior", "author_id": 40933, "author_profile": "https://Stackoverflow.com/users/40933", "pm_score": 2, "selected": false, "text": "<p>The binding expression to bind this component to the bean value=\"#{threadController.queryCategories}\".So value attrib...
2009/01/10
[ "https://Stackoverflow.com/questions/431123", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
can some one help me with the following JSF dataTable? here I am getting data from database table and I used dataTable binding, but I don't know why it displays the rows 3 times in the screen, but if I remove the binding then it displays only one time. --- ``` <h:dataTable binding="#{threadController.dataTable}" var=...
The binding expression to bind this component to the bean value="#{threadController.queryCategories}".So value attribute is sufficient to retrieve data using dataTable tag.
431,138
<p>When doing thread synchronization in C# should I also lock an object when I read a value or just changing it?</p> <p>for example I have Queue&lt;T&gt; object. Should I just lock it when doing the Enqueue and Dequeue or should I also lock it when checking values like Count?</p>
[ { "answer_id": 431144, "author": "mmx", "author_id": 33708, "author_profile": "https://Stackoverflow.com/users/33708", "pm_score": 2, "selected": false, "text": "<p>Depends on what you want to do with lock. Usually this kind of locking needs a reader/writer locking mechanism.</p>\n\n<p>R...
2009/01/10
[ "https://Stackoverflow.com/questions/431138", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20183/" ]
When doing thread synchronization in C# should I also lock an object when I read a value or just changing it? for example I have Queue<T> object. Should I just lock it when doing the Enqueue and Dequeue or should I also lock it when checking values like Count?
From MSDN: > > A Queue<(Of <(T>)>) can support > multiple readers concurrently, as long > as the collection is not modified. > Even so, enumerating through a > collection is intrinsically not a > thread-safe procedure. To guarantee > thread safety during enumeration, you > can lock the collection during the > ...
431,159
<p>Is there an existing Java library that could tell me whether a String contains English language text or not (e.g. I need to be able to distinguish French or Italian text -- the function needs to return false for French and Italian, and true for English)?</p>
[ { "answer_id": 431181, "author": "Filip Ekberg", "author_id": 39106, "author_profile": "https://Stackoverflow.com/users/39106", "pm_score": 0, "selected": false, "text": "<p>There's no \"good\" way of doing this imo. All answers can be very complicated on this topic. The obvious part is ...
2009/01/10
[ "https://Stackoverflow.com/questions/431159", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Is there an existing Java library that could tell me whether a String contains English language text or not (e.g. I need to be able to distinguish French or Italian text -- the function needs to return false for French and Italian, and true for English)?
There are various techniques, and a robust method would combine various ones: * look at the **frequencies of groups of *n* letters** (say, groups of 3 letters or **trigrams**) in your text and see if they are similar to the frequencies found for the language you are testing against * look at whether the **instances of...
431,165
<p>Okay, I've got my normal app which is in portrait mode. I can force my app to go to landscape mode for a view (using navigationcontroller and viewcontroller) like this:</p> <pre><code>- (void)viewWillAppear:(BOOL)animated { [[UIDevice currentDevice] setOrientation:UIInterfaceOrientationLandscapeRight]; } </code...
[ { "answer_id": 431214, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 0, "selected": false, "text": "<p>You need to edit your Info.plist file to add the UIInterfaceOrientation key with the appropriate value (UIInterfaceOrientat...
2009/01/10
[ "https://Stackoverflow.com/questions/431165", "https://Stackoverflow.com", "https://Stackoverflow.com/users/53677/" ]
Okay, I've got my normal app which is in portrait mode. I can force my app to go to landscape mode for a view (using navigationcontroller and viewcontroller) like this: ``` - (void)viewWillAppear:(BOOL)animated { [[UIDevice currentDevice] setOrientation:UIInterfaceOrientationLandscapeRight]; } ``` But then when ...
Take a look at the function [shouldAutorotateToInterfaceOrientation:](https://developer.apple.com/documentation/uikit/uiviewcontroller/1621459-shouldautorotatetointerfaceorien?language=objc) in the UIViewController class. This function returns YES if the orientations are supported by your UIView. If you return YES only...
431,203
<p>This question is inspired by Jon Skeet's answer: <a href="https://stackoverflow.com/questions/431091/is-there-a-c-equivalent-to-cs-access-modifier-regions#431105">Is there a c# equivalent to c++&#39;s access-modifier regions</a></p> <p>He makes a comment that it is possible for the order of fields in a file to matt...
[ { "answer_id": 431212, "author": "mmx", "author_id": 33708, "author_profile": "https://Stackoverflow.com/users/33708", "pm_score": 2, "selected": false, "text": "<p>Yeah, it does matter when interfacing with unmanaged code.</p>\n" }, { "answer_id": 431221, "author": "Jon Skee...
2009/01/10
[ "https://Stackoverflow.com/questions/431203", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26160/" ]
This question is inspired by Jon Skeet's answer: [Is there a c# equivalent to c++'s access-modifier regions](https://stackoverflow.com/questions/431091/is-there-a-c-equivalent-to-cs-access-modifier-regions#431105) He makes a comment that it is possible for the order of fields in a file to matter. I am guessing that th...
Here is a classic example from the C# language spec (Section 10.5.5) ``` class Test { static int a = b + 1; static int b = a + 1; static void Main() { Console.WriteLine("a = {0}, b = {1}", a, b); } } ``` This is a completely valid program and as written (a = 1, b =2). However if you swap the ...
431,205
<p>How would I go about programmatically changing the desktop background in Mac OS X? I'd like to use python, but I'm interested in any way possible. Could I hook up to Terminal and call a certain command?</p>
[ { "answer_id": 431273, "author": "Matt Miller", "author_id": 763, "author_profile": "https://Stackoverflow.com/users/763", "pm_score": 3, "selected": false, "text": "<p>You can call \"defaults write com.apple.Desktop Background ...\" as described in this article: <a href=\"http://thingst...
2009/01/10
[ "https://Stackoverflow.com/questions/431205", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1615/" ]
How would I go about programmatically changing the desktop background in Mac OS X? I'd like to use python, but I'm interested in any way possible. Could I hook up to Terminal and call a certain command?
From python, if you have [appscript](http://appscript.sourceforge.net/) installed (`sudo easy_install appscript`), you can simply do ``` from appscript import app, mactypes app('Finder').desktop_picture.set(mactypes.File('/your/filename.jpg')) ``` Otherwise, this applescript will change the desktop background ``` t...
431,206
<p>Firstly,</p> <p>Using <b>plain</b> C++, without ATL, MFC attempting to use COM Object interface.</p> <p>Using <b>oleview</b> (OLE/COM Object viewer) - used to engineer the IDL code.</p> <p>At this stage, using <b>MIDL</b> Compiler, now I'm having trouble trying to produce the following:</p> <p>Syntax on cmd line...
[ { "answer_id": 431273, "author": "Matt Miller", "author_id": 763, "author_profile": "https://Stackoverflow.com/users/763", "pm_score": 3, "selected": false, "text": "<p>You can call \"defaults write com.apple.Desktop Background ...\" as described in this article: <a href=\"http://thingst...
2009/01/10
[ "https://Stackoverflow.com/questions/431206", "https://Stackoverflow.com", "https://Stackoverflow.com/users/51078/" ]
Firstly, Using **plain** C++, without ATL, MFC attempting to use COM Object interface. Using **oleview** (OLE/COM Object viewer) - used to engineer the IDL code. At this stage, using **MIDL** Compiler, now I'm having trouble trying to produce the following: Syntax on cmd line: midl /nologo /env win32 /tlb ".\S8\_....
From python, if you have [appscript](http://appscript.sourceforge.net/) installed (`sudo easy_install appscript`), you can simply do ``` from appscript import app, mactypes app('Finder').desktop_picture.set(mactypes.File('/your/filename.jpg')) ``` Otherwise, this applescript will change the desktop background ``` t...
431,208
<p>HI Guys,</p> <p>I own a website I have a section called "mobile Section" this section contain many catagories (Nameoftheobject + a picture + little description and a download link) Now the section is considered as an internal section. I want to view random records from that section on the first page (I dont know Li...
[ { "answer_id": 431248, "author": "DavGarcia", "author_id": 40161, "author_profile": "https://Stackoverflow.com/users/40161", "pm_score": -1, "selected": false, "text": "<p>Do you really want it to be random? Its nice to have most popular on home pages and might turn out to be more useful...
2009/01/10
[ "https://Stackoverflow.com/questions/431208", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
HI Guys, I own a website I have a section called "mobile Section" this section contain many catagories (Nameoftheobject + a picture + little description and a download link) Now the section is considered as an internal section. I want to view random records from that section on the first page (I dont know Like RSS but...
Whatever you do, don't use ORDER BY RAND() in MySQL. It won't scale. Yes, it will seem to work fine for a small number of rows because the data set is small. ORDER BY RAND() requires a full-table scan, which means that the larger your table is the longer the query will take. This will manifest itself like "Gee, the web...
431,217
<p>For anyone who places braces thus:</p> <pre><code>void f() { stuff(); } </code></pre> <p>How do you prefer to place braces after long initializer lists?<br> The same way?</p> <pre><code>Object::Object() : foo(1) , bar(2) { stuff(); } </code></pre> <p>Or make an exception so you actually see where...
[ { "answer_id": 431227, "author": "Paul Beckingham", "author_id": 14356, "author_profile": "https://Stackoverflow.com/users/14356", "pm_score": 2, "selected": false, "text": "<p>It seems important to be able to detect where the ctor-initializer list begins/ends, and where the code block b...
2009/01/10
[ "https://Stackoverflow.com/questions/431217", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
For anyone who places braces thus: ``` void f() { stuff(); } ``` How do you prefer to place braces after long initializer lists? The same way? ``` Object::Object() : foo(1) , bar(2) { stuff(); } ``` Or make an exception so you actually see where the init list ends? ``` Object::Object() : f...
It seems important to be able to detect where the ctor-initializer list begins/ends, and where the code block begins/ends. ``` Object::Object () : foo (1) , bar (2) { ... } ```
431,230
<p>Open up a Rails console and enter this:</p> <pre><code>2.weeks.ago.between? 2.weeks.ago, 1.week.ago </code></pre> <p>Did it give you true or false? No really, try it a few more times and it will give you different answers.</p> <p>Now, I'm thinking that because we're comparing 2.weeks.ago with 2.weeks.ago, the tim...
[ { "answer_id": 431282, "author": "tvanfosson", "author_id": 12950, "author_profile": "https://Stackoverflow.com/users/12950", "pm_score": 4, "selected": true, "text": "<p>The cause is undoubtedly due to the resolution of the time function. Sometimes the two instances of 2.weeks.ago reso...
2009/01/10
[ "https://Stackoverflow.com/questions/431230", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6291/" ]
Open up a Rails console and enter this: ``` 2.weeks.ago.between? 2.weeks.ago, 1.week.ago ``` Did it give you true or false? No really, try it a few more times and it will give you different answers. Now, I'm thinking that because we're comparing 2.weeks.ago with 2.weeks.ago, the time between evaluating the two stat...
The cause is undoubtedly due to the resolution of the time function. Sometimes the two instances of 2.weeks.ago resolve to the same time and sometimes they don't. When you use yesterday you don't see the issue because it always resolves to zero hour instead of relative to the current time. In a case like yours you pro...
431,233
<p>I'm trying to use the Server class from Cassini to include a basic web server in my own application. I just started playing around with it to get familiar with the way the server works and I setup a simple app that is as follows:</p> <pre><code> static void Main(string[] args) { Server server = new ...
[ { "answer_id": 431326, "author": "Kev", "author_id": 419, "author_profile": "https://Stackoverflow.com/users/419", "pm_score": 3, "selected": true, "text": "<p><code>.cs</code> files and many source code types are prevented from rendering because they are handled by ASP.NET's forbidden f...
2009/01/10
[ "https://Stackoverflow.com/questions/431233", "https://Stackoverflow.com", "https://Stackoverflow.com/users/194/" ]
I'm trying to use the Server class from Cassini to include a basic web server in my own application. I just started playing around with it to get familiar with the way the server works and I setup a simple app that is as follows: ``` static void Main(string[] args) { Server server = new Server(80, "/",...
`.cs` files and many source code types are prevented from rendering because they are handled by ASP.NET's forbidden file handler. This is initially configured in the following setting in the master web.config in `c:\windows\microsoft.net\v2.0.50727\CONFIG\web.config`: Look for in the `<httpHandlers>` section, you see...
431,254
<p>I'm working with Quickbook's IIF file format and I need to write a parser to read and write IIF files and I'm running into some issues reading the files.</p> <p>The files are simple, they're tab deliminated. Every line is either a table definition or a row. Definitions begin with'!' and the table name, and rows beg...
[ { "answer_id": 431265, "author": "Dmitri Nesteruk", "author_id": 9476, "author_profile": "https://Stackoverflow.com/users/9476", "pm_score": 0, "selected": false, "text": "<p>Why not replace line breaks with spaces instead of tabs?</p>\n" }, { "answer_id": 431381, "author": "...
2009/01/10
[ "https://Stackoverflow.com/questions/431254", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12243/" ]
I'm working with Quickbook's IIF file format and I need to write a parser to read and write IIF files and I'm running into some issues reading the files. The files are simple, they're tab deliminated. Every line is either a table definition or a row. Definitions begin with'!' and the table name, and rows begin with ju...
I did it: ``` public DataSet parseIIF(Stream file) { iifSet = new DataSet(); String fileText; using (StreamReader sr = new StreamReader(file)) { fileText = sr.ReadToEnd(); } //replace line breaks with tabs //fileText.Replace('\n'...
431,281
<p>As an addition to my previous post on <a href="https://stackoverflow.com/questions/409087/creating-a-web-server-in-pure-c">Creating a web server in pure C</a>, I'm having some trouble with the Sending function. Here's two code snippets:</p> <pre><code>int Send(char *message) { int length, bytes_sent; ...
[ { "answer_id": 431294, "author": "Joachim Sauer", "author_id": 40342, "author_profile": "https://Stackoverflow.com/users/40342", "pm_score": 4, "selected": true, "text": "<p>Since you're sending the content-length, the browser won't be accepting no more content after \"HAaaaii!!\" and th...
2009/01/10
[ "https://Stackoverflow.com/questions/431281", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39106/" ]
As an addition to my previous post on [Creating a web server in pure C](https://stackoverflow.com/questions/409087/creating-a-web-server-in-pure-c), I'm having some trouble with the Sending function. Here's two code snippets: ``` int Send(char *message) { int length, bytes_sent; length = strlen(message...
Since you're sending the content-length, the browser won't be accepting no more content after "HAaaaii!!" and therfore will interpret the "lolwut?" as a part of the answer of its next request, which will of course fail. You could skip sending a content-length, but this would mean that you are not using keep-alive and ...
431,296
<p>I'm trying to build a very, very simple "micro-webapp" which I suspect will be of interest to a few Stack Overflow'rs if I ever get it done. I'm hosting it on my C# in Depth site, which is vanilla ASP.NET 3.5 (i.e. not MVC).</p> <p>The flow is very simple:</p> <ul> <li>If a user enters the app with a URL which doe...
[ { "answer_id": 431316, "author": "tvanfosson", "author_id": 12950, "author_profile": "https://Stackoverflow.com/users/12950", "pm_score": 1, "selected": false, "text": "<p>Have you thought about not eliminating the POST but rather redirecting to a suitable GET url when the form is POSTed...
2009/01/10
[ "https://Stackoverflow.com/questions/431296", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22656/" ]
I'm trying to build a very, very simple "micro-webapp" which I suspect will be of interest to a few Stack Overflow'rs if I ever get it done. I'm hosting it on my C# in Depth site, which is vanilla ASP.NET 3.5 (i.e. not MVC). The flow is very simple: * If a user enters the app with a URL which doesn't specify all the ...
This solution will give you programmatic access to the controls in their entirety including all attributes on the controls. Also, only the text box values will appear in the URL upon submission so your GET request URL will be more "meaningful" ``` <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="JonSkeetForm....
431,311
<p>I`m writing client-server app for windows using WinSock and I have class for server.<br> while initialising server I have such code:</p> <pre><code> class Server { static const int MaxClients = 10; std::vector connections; CRITICAL_SECTION cs; int port; SOCKET ServerSocket; sockaddr_in Serve...
[ { "answer_id": 431319, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 3, "selected": true, "text": "<p>It depends on whether you're actually going to <em>handle</em> the exception, e.g. retry with a slightly different inp...
2009/01/10
[ "https://Stackoverflow.com/questions/431311", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28298/" ]
I`m writing client-server app for windows using WinSock and I have class for server. while initialising server I have such code: ``` class Server { static const int MaxClients = 10; std::vector connections; CRITICAL_SECTION cs; int port; SOCKET ServerSocket; sockaddr_in ServerAddress; v...
It depends on whether you're actually going to *handle* the exception, e.g. retry with a slightly different input, or decide to ignore the problem and proceed anyway (rarely appropriate, but *can* be useful). In this case, you may well want to catch the exception close to its source. In most cases, the only thing you ...
431,338
<p>Basically the app writes the contents of a Collection to XML. I'm using XMLStreamWriter (<code>XMLOutputFactory.newInstance().createXMLStreamWriter(...)</code>) for this purpose.</p> <p>Works great except for the fact that I can't get how to append data to an existing file. Don't really like the idea of reading all...
[ { "answer_id": 431374, "author": "Phil", "author_id": 49642, "author_profile": "https://Stackoverflow.com/users/49642", "pm_score": 2, "selected": false, "text": "<p>Simply appending to an XML file will result in malformed XML. You should build the DOM and attach what new elements you n...
2009/01/10
[ "https://Stackoverflow.com/questions/431338", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15187/" ]
Basically the app writes the contents of a Collection to XML. I'm using XMLStreamWriter (`XMLOutputFactory.newInstance().createXMLStreamWriter(...)`) for this purpose. Works great except for the fact that I can't get how to append data to an existing file. Don't really like the idea of reading all of it first, appendi...
If you're appending a top-level element, you can probably get away with doing what you want. e.g., If you have this file: ``` <some_element> <nested_element> ... </nested_element> </some_element> ``` you can most likely get away with appending another `some_element` element. However, you're obviously screwe...
431,339
<p>Is it possible to have something like the following:</p> <pre><code>class C { public Foo Foos[int i] { ... } public Bar Bars[int i] { ... } } </code></pre> <p>If not, then are what are some of the ways I can achieve this? I know I could make functions called getFoo(int i) a...
[ { "answer_id": 431345, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 5, "selected": true, "text": "<p>Not in C#, no.</p>\n\n<p>However, you can always return collections from properties, as follows:</p>\n\n<pre><code>public IL...
2009/01/10
[ "https://Stackoverflow.com/questions/431339", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26566/" ]
Is it possible to have something like the following: ``` class C { public Foo Foos[int i] { ... } public Bar Bars[int i] { ... } } ``` If not, then are what are some of the ways I can achieve this? I know I could make functions called getFoo(int i) and getBar(int i) but I was...
Not in C#, no. However, you can always return collections from properties, as follows: ``` public IList<Foo> Foos { get { return ...; } } public IList<Bar> Bars { get { return ...; } } ``` IList<T> has an indexer, so you can write the following: ``` C whatever = new C(); Foo myFoo = whatever.Foos[13]; ``...