Id int64 4 8.51M | PostTypeId int64 1 7 | AcceptedAnswerId int64 7 75.5M ⌀ | ParentId int64 4 41.8M ⌀ | Score int64 -208 27.7k | ViewCount int64 11 12.4M ⌀ | Body stringlengths 0 45k | Title stringlengths 2 150 ⌀ | ContentLicense stringclasses 3
values | FavoriteCount int64 0 225 ⌀ | CreationDate stringdate 2008-07-31 21:42:52 2011-12-14 18:48:47 | LastActivityDate stringdate 2008-08-01 12:19:17 2023-03-05 04:40:26 | LastEditDate stringdate 2008-08-01 13:54:25 2023-03-05 03:12:45 ⌀ | LastEditorUserId int64 -1 21.3M ⌀ | OwnerUserId int64 -1 21.1M ⌀ | Tags listlengths 1 6 ⌀ |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
13,550 | 1 | 13,668 | null | 2 | 554 | I was using a CASE called [MAGIC](http://www.magicsoftware.com/) for a system I'm developing, I've never used this kind of tool before and at first sight I liked, a month later I had a lot of the application generated, I felt very productive and ... I would say ... satisfied.
In some way a felt uncomfortable, cause, t... | Productivity gains of using CASE tools for development | CC BY-SA 3.0 | null | 2008-08-17T07:08:41.383 | 2018-03-05T22:17:49.680 | 2018-03-05T22:17:49.680 | 1,710,577 | 1,130,097 | [
"case-tools"
] |
13,566 | 2 | null | 13,471 | 0 | null | Not exactly what you are looking for but it could be an option if you can't find a native VCL component.
Tree GX [http://www.componentsource.com/products/treegx/index-gbp.html](http://www.componentsource.com/products/treegx/index-gbp.html) is a .NET mind map component with source code.
You could then use Hydra [http:... | null | CC BY-SA 2.5 | null | 2008-08-17T09:25:39.627 | 2008-08-17T09:25:39.627 | null | null | 922 | null |
13,571 | 2 | null | 13,569 | 57 | null | Moving an application from one database to another isn't very common, but sooner or later you may find yourself working on another project using a different RDBMS. If you're at home with PDO then there will at least be one thing less to learn at that point.
Apart from that I find the PDO API a little more intuitive, a... | null | CC BY-SA 2.5 | null | 2008-08-17T09:55:03.420 | 2008-08-17T09:55:03.420 | null | null | 1,109 | null |
13,561 | 1 | null | null | 3 | 2,714 | Here is one trivial question, that I am not sure how to handle.
I need to display list of categories on every page, and to be able to choose items from a specific category to be displayed. I use asp.net MVC, and have chosen to create a user control that will display categories. My question is: what is the best approach... | user controls and asp.net mvc | CC BY-SA 3.0 | null | 2008-08-17T08:25:46.440 | 2014-03-08T23:54:53.317 | 2014-03-08T23:54:53.317 | 1,644,214 | 481 | [
"asp.net",
"asp.net-mvc",
"user-controls"
] |
13,578 | 1 | 13,600 | null | 5 | 24,070 | The need arose, in our product, to determine how long the current user has been logged on to Windows (specifically, Vista). It seems there is no straight forward API function for this and I couldn't find anything relevant with WMI (although I'm no expert with WMI, so I might have missed something).
Any ideas?
| Determining how long the user is logged on to Windows | CC BY-SA 2.5 | 0 | 2008-08-17T10:22:25.877 | 2020-10-15T08:30:16.640 | null | null | 1,596 | [
"windows"
] |
13,563 | 2 | null | 8,042 | 2 | null | I see separating the domain/model and UI/view functionality using extension methods as a good thing, especially since they can reside in separate namespaces.
For example:
```
namespace Model
{
class Person
{
public string Title { get; set; }
public string FirstName { get; set; }
public... | null | CC BY-SA 2.5 | null | 2008-08-17T09:00:27.943 | 2008-08-17T09:00:27.943 | null | null | 891 | null |
13,577 | 2 | null | 13,293 | 3 | null | If your site is database-driven I would be very surprised if your bottleneck would be the application framework. "Fast" as in faster development is what I would worry about rather than "fast" as in speedy handling of requests. Significant optimization is better done by caching strategies and optimizing your database ac... | null | CC BY-SA 2.5 | null | 2008-08-17T10:17:57.103 | 2008-08-17T10:17:57.103 | null | null | 1,109 | null |
13,569 | 1 | null | null | 342 | 147,547 | In our place we're split between using mysqli and PDO for stuff like prepared statements and transaction support. Some projects use one, some the other. There is little realistic likelihood of us ever moving to another RDBMS.
I prefer PDO for the single reason that it allows named parameters for prepared statements, a... | mysqli or PDO - what are the pros and cons? | CC BY-SA 2.5 | 0 | 2008-08-17T09:47:22.610 | 2013-03-04T12:41:59.047 | 2009-03-06T16:52:02.097 | null | 137 | [
"php",
"mysql",
"pdo",
"mysqli",
"database-abstraction"
] |
13,574 | 2 | null | 13,518 | 0 | null | Not a complete solution to this problem, but I've found [FoxMarks](http://www.foxmarks.com/) to be a really nice bookmark syncing extension.
| null | CC BY-SA 2.5 | null | 2008-08-17T10:04:18.923 | 2008-08-17T10:04:18.923 | null | null | 1,370 | null |
13,583 | 2 | null | 13,021 | 6 | null | I try to follow the Yahoo convention of making a single parent object out in the global scope to contain everything;
```
var FP = {};
FP.module = {};
FP.module.property = 'foo';
```
| null | CC BY-SA 2.5 | null | 2008-08-17T10:46:13.347 | 2008-08-17T10:46:13.347 | null | null | 137 | null |
13,579 | 2 | null | 13,454 | -4 | null | Python has a built-in escape() function analogous to PHP's addslashes, but no unescape() function (stripslashes), which in my mind is kind of ridiculous.
Regular expressions to the rescue (code not tested):
```
p = re.compile( '\\(\\\S)')
p.sub('\1',escapedstring)
```
In theory that takes anything of the form \\(no... | null | CC BY-SA 2.5 | null | 2008-08-17T10:28:00.967 | 2008-08-17T10:48:37.570 | 2008-08-17T10:48:37.587 | 1,370 | 1,370 | null |
13,580 | 2 | null | 13,561 | 2 | null | I'm using mvc components, which replaced ascx user controls in preview 4.
Example:
[http://blog.wekeroad.com/blog/asp-net-mvc-preview-4-componentcontroller-is-now-renderaction/](http://blog.wekeroad.com/blog/asp-net-mvc-preview-4-componentcontroller-is-now-renderaction/)
So, you call components action from View, which ... | null | CC BY-SA 2.5 | null | 2008-08-17T10:30:14.317 | 2008-08-17T10:30:14.317 | null | null | 1,407 | null |
13,584 | 2 | null | 13,561 | 1 | null | it is the mvc futures project. i will probably try this
[http://forums.asp.net/t/1303328.aspx](http://forums.asp.net/t/1303328.aspx). I need to render menu with categories.
| null | CC BY-SA 2.5 | null | 2008-08-17T11:02:40.617 | 2008-08-17T11:02:40.617 | null | null | 481 | null |
13,582 | 2 | null | 13,293 | 9 | null | Yes, the problem is you have to build your application to profile it.
At work we had a couple of projects written outside which we load-tested before putting them on our main boxes. We were quite surprised to find critical performance problems with both; one was written in CakePHP and the other was written using Drup... | null | CC BY-SA 2.5 | null | 2008-08-17T10:39:26.747 | 2008-08-17T10:39:26.747 | null | null | 137 | null |
13,585 | 2 | null | 4,544 | 2 | null | @travis Looks very nice! I will sure take a look into it. I can think of several places I can use that
I never got round to sniff the traffic but found out that a php site on my own server with http-auth worked fine, so i figured it was something with delicious. I then created a php page that does a wget of the delici... | null | CC BY-SA 2.5 | null | 2008-08-17T11:09:03.753 | 2008-08-17T11:09:03.753 | null | null | 86 | null |
13,586 | 1 | 13,605 | null | 5 | 1,147 | If there are any language designers out there (or people simply in the know), I'm curious about the methodology behind creating standard libraries for interpreted languages. Specifically, what seems to be the best approach? Defining standard functions/methods in the interpreted language, or performing the processing of... | Interpreted languages - leveraging the compiled language behind the interpreter | CC BY-SA 2.5 | 0 | 2008-08-17T11:12:51.813 | 2018-06-19T16:23:59.947 | 2018-06-19T16:23:59.947 | 578,411 | 1,344 | [
"performance",
"language-agnostic",
"language-features",
"interpreted-language"
] |
13,594 | 1 | null | null | 4 | 6,725 | Do you know of any differences in handling HTML tags/properties in different browsers? For example, I once saw a page with a input tag with a maxlength field set to "2o". Firefox and Opera ignore the "o", and set the max length to 2, while Internet Explorer ignores the field altogether. Do you know of any more?
(Note:... | HTML differences between browsers | CC BY-SA 2.5 | 0 | 2008-08-17T12:02:23.600 | 2009-12-17T21:51:34.217 | 2008-08-23T16:19:42.037 | 1,190 | 1,536 | [
"html",
"browser"
] |
13,589 | 1 | 32,081 | null | 2 | 5,694 | I wonder if someone knows if there is a pre-made solution for this: I have a List on an ASP.net Website, and I want that the User is able to re-sort the list through Drag and Drop. Additionally, I would love to have a second list to which the user can drag items from the first list onto.
So far, I found two solutions:... | ASP.net AJAX Drag/Drop? | CC BY-SA 2.5 | 0 | 2008-08-17T11:40:38.963 | 2014-12-29T23:48:49.723 | null | null | 91 | [
"asp.net",
"ajax"
] |
13,596 | 2 | null | 13,594 | 6 | null | Check out [http://www.quirksmode.org/](http://www.quirksmode.org/)
| null | CC BY-SA 2.5 | null | 2008-08-17T12:04:27.247 | 2008-08-17T12:04:27.247 | null | null | 1,175 | null |
13,581 | 2 | null | 13,578 | 1 | null | In WMI do: "select * from Win32_Session"
there you'll have "StartTime" value.
Hope that helps.
| null | CC BY-SA 2.5 | null | 2008-08-17T10:33:36.400 | 2008-08-17T10:33:36.400 | null | null | 1,534 | null |
13,590 | 2 | null | 13,589 | 2 | null | This is just personal opinion, but the problem I find with ready-made controls in cases like this is that they are extremely bloated, because they're trying to fit everybody's purpose. If all you need is a sortable list then a simple [Scriptaculous list](http://demo.script.aculo.us/ajax/sortable_elements) or [jQuery l... | null | CC BY-SA 2.5 | null | 2008-08-17T11:49:10.397 | 2008-08-17T11:49:10.397 | null | null | 192 | null |
13,598 | 2 | null | 13,454 | 13 | null | Not totally sure this is what you want, but..
```
cleaned = stringwithslashes.decode('string_escape')
```
| null | CC BY-SA 2.5 | null | 2008-08-17T12:15:13.170 | 2008-08-17T12:15:13.170 | null | null | 745 | null |
13,599 | 1 | 13,613 | null | 27 | 7,989 | Does anyone know how to transform a enum value to a human readable value?
For example:
> ThisIsValueA should be "This is Value A".
| Convert enums to human readable values | CC BY-SA 3.0 | 0 | 2008-08-17T12:24:21.840 | 2022-07-21T14:04:19.840 | 2014-07-15T12:53:26.737 | 2,771,704 | 1,154 | [
"c#",
"enums",
"human-readable"
] |
13,608 | 2 | null | 13,454 | 3 | null | It sounds like what you want could be reasonably efficiently handled through regular expressions:
```
import re
def stripslashes(s):
r = re.sub(r"\\(n|r)", "\n", s)
r = re.sub(r"\\", "", r)
return r
cleaned = stripslashes(stringwithslashes)
```
| null | CC BY-SA 2.5 | null | 2008-08-17T12:55:25.100 | 2008-08-17T12:55:25.100 | null | null | 893 | null |
13,602 | 2 | null | 13,599 | 5 | null | Most examples of this that I've seen involve marking your enum values up with [Description] attributes and using reflection to do the "conversion" between the value and the description. Here's an old blog post about it:
<[Link](https://web.archive.org/web/20201125032118/http://geekswithblogs.net/rakker/archive/2006/05/... | null | CC BY-SA 4.0 | null | 2008-08-17T12:28:36.230 | 2022-07-21T14:04:19.840 | 2022-07-21T14:04:19.840 | 4,751,173 | 615 | null |
13,612 | 2 | null | 13,607 | 1 | null | [http://www.fox-toolkit.org](http://www.fox-toolkit.org/) has an API reference, if you're looking how to work with a specific framework. Or were you more interested in general theory or something more along the lines of how to do the low-level stuff yourself?
| null | CC BY-SA 2.5 | null | 2008-08-17T13:03:00.653 | 2008-08-17T13:03:00.653 | null | null | 1,344 | null |
13,609 | 2 | null | 13,607 | 1 | null | Have a look at [Qt](https://www.qt.io/download-open-source/). It is an open source library for making GUI's. Unlike Swing in Java, it assumes a lot of stuff, so it is really easy to make functional GUI's. For example, a textarea assumes that you want a context menu when you right click it with copy, paste, select all, ... | null | CC BY-SA 3.0 | null | 2008-08-17T12:58:57.013 | 2016-09-12T08:44:43.950 | 2016-09-12T08:44:43.950 | 1,798,015 | 1,585 | null |
13,610 | 2 | null | 13,599 | 2 | null | You can also take a look at this article: [http://www.codeproject.com/KB/cs/enumdatabinding.aspx](http://www.codeproject.com/KB/cs/enumdatabinding.aspx)
It's specifically about data binding, but shows how to use an attribute to decorate the enum values and provides a "GetDescription" method to retrieve the text of the... | null | CC BY-SA 2.5 | null | 2008-08-17T13:00:10.487 | 2008-08-17T13:00:10.487 | null | null | 1,559 | null |
13,611 | 2 | null | 13,599 | 4 | null | You can inherit from the "Attribute" class of System.Reflection to create your own "Description" class. Like this (from [here](http://blogs.msdn.com/abhinaba/archive/2005/10/20/483000.aspx)):
```
using System;
using System.Reflection;
namespace FunWithEnum
{
enum Coolness : byte
{
[Description("Not so... | null | CC BY-SA 3.0 | null | 2008-08-17T13:01:02.030 | 2016-03-25T09:48:20.533 | 2016-03-25T09:48:20.533 | 77,004 | 194 | null |
13,605 | 2 | null | 13,586 | 6 | null | The line between "interpreted" and "compiled" languages is really fuzzy these days. For example, the first thing Python does when it sees source code is compile it into a bytecode representation, essentially the same as what Java does when compiling class files. This is what *.pyc files contain. Then, the python runtim... | null | CC BY-SA 2.5 | null | 2008-08-17T12:39:58.860 | 2008-08-17T12:39:58.860 | null | null | 893 | null |
13,607 | 1 | 13,618 | null | 1 | 1,807 | Could someone recommend any good resources for creating Graphics User Interfaces, preferably in C/C++?
Currently my biggest influence is [3DBuzz.com](http://www.3dbuzz.com)'s [C++/OpenGL VTMs](http://www.3dbuzz.com/xcart/product.php?productid=30&cat=12&page=1) (Video Training Modules). While they are very good, they c... | GUI system development resources? | CC BY-SA 3.0 | 0 | 2008-08-17T12:50:15.000 | 2016-12-20T08:58:34.400 | 2017-05-23T12:26:29.837 | -1 | 3,180 | [
"c++",
"user-interface",
"playstation-portable"
] |
13,600 | 2 | null | 13,578 | 4 | null | For people not familiar with WMI (like me), here are some links:
- [http://msdn.microsoft.com/en-us/library/aa393964(VS.85).aspx](http://msdn.microsoft.com/en-us/library/aa393964(VS.85).aspx)- [http://msdn.microsoft.com/en-us/library/aa394422(VS.85).aspx](http://msdn.microsoft.com/en-us/library/aa394422(VS.85).aspx)[h... | null | CC BY-SA 2.5 | null | 2008-08-17T12:24:51.310 | 2008-08-17T12:40:58.233 | 2008-08-17T12:40:58.233 | 1,026 | 1,026 | null |
13,613 | 2 | null | 13,599 | 19 | null | Converting this from a vb code snippet that a certain Ian Horwill left at a [blog post long ago](http://secretgeek.net/progr_purga.asp)... i've since used this in production successfully.
```
/// <summary>
/// Add spaces to separate the capitalized words in the string,
/// i.e. insert a space before each uppe... | null | CC BY-SA 2.5 | null | 2008-08-17T13:10:20.513 | 2008-08-17T13:15:46.790 | 2008-08-17T13:15:46.790 | 49 | 49 | null |
13,620 | 1 | 13,665 | null | 57 | 24,128 | (assume php5) consider
```
<?php
$foo = 'some words';
//case 1
print "these are $foo";
//case 2
print "these are {$foo}";
//case 3
print 'these are ' . $foo;
?>
```
Is there much of a difference between 1 and 2?
If not, what about between 1/2 and 3?
| Speed difference in using inline strings vs concatenation in php5? | CC BY-SA 3.0 | 0 | 2008-08-17T13:19:32.587 | 2021-07-15T09:56:04.250 | 2016-04-29T14:45:39.087 | 4,311,889 | 314 | [
"php",
"optimization",
"performance"
] |
13,615 | 1 | 4,807,469 | null | 94 | 80,491 | I need to validate an integer to know if is a valid enum value.
What is the best way to do this in C#?
| Validate Enum Values | CC BY-SA 3.0 | 0 | 2008-08-17T13:14:42.720 | 2022-09-27T11:26:06.547 | 2013-12-06T13:09:22.877 | 588,306 | 1,154 | [
"c#",
"validation",
"enums"
] |
13,624 | 2 | null | 11,491 | 4 | null | As Darren told you, the easiest method is to use std::transform.
But beware that in some language, like German for instance, there isn't always a one to one mapping between lower and uppercase. The "esset" lowercase character (look like the Greek character beta) is transformed to "SS" in uppercase.
| null | CC BY-SA 2.5 | null | 2008-08-17T13:30:59.770 | 2008-08-17T13:30:59.770 | null | null | 1,578 | null |
13,614 | 2 | null | 6,957 | 2 | null | I use GPT at work since 2007, and I totally satisfied. I use it to monitor and optimize a Linux network library, and I have obtained a significant results.
The main flaw of GPT is the lack of precision. Due to the design, you only got the main time consuming functions, but this is often what you need when you want to ... | null | CC BY-SA 2.5 | null | 2008-08-17T13:12:24.300 | 2008-08-17T13:12:24.300 | null | null | 1,578 | null |
13,627 | 2 | null | 13,586 | 3 | null | There's also an increasing trend of reimplementing languages that are traditionally considered "interpreted" onto a platform like the JVM or CLR -- and then allowing easy access to "native" code for interoperability. So from Jython and JRuby, you can easily access Java code, and from IronPython and IronRuby, you can e... | null | CC BY-SA 2.5 | null | 2008-08-17T13:33:17.053 | 2008-08-17T13:33:17.053 | null | null | 533 | null |
13,635 | 2 | null | 13,615 | 9 | null | Brad Abrams specifically warns against `Enum.IsDefined` in his post [The Danger of Oversimplification](https://learn.microsoft.com/en-us/archive/blogs/brada/the-danger-of-over-simplification-enum-isdefined).
The best way to get rid of this requirement (that is, the need to validate enums) is to remove ways where user... | null | CC BY-SA 4.0 | null | 2008-08-17T13:46:20.833 | 2020-04-08T23:49:35.693 | 2020-04-08T23:49:35.693 | 21,698 | 372 | null |
13,621 | 2 | null | 13,434 | 0 | null | The right way is to use the `StackTrace` and `StackFrame` classes. Throwing an exception just to get the stack trace is completely misusing exceptions.
| null | CC BY-SA 3.0 | null | 2008-08-17T13:20:43.723 | 2013-04-28T03:23:05.830 | 2013-04-28T03:23:05.830 | 1,012,641 | 1,559 | null |
13,632 | 2 | null | 13,586 | 1 | null | As long as you are using a portable API for the compiled code base like the [ANSI C standard library](http://en.wikipedia.org/wiki/C_standard_library) or [STL](http://en.wikipedia.org/wiki/Standard_Template_Library) in C++, then taking advantage of those functions would keep you from reinventing the wheel and likely pr... | null | CC BY-SA 2.5 | null | 2008-08-17T13:41:11.327 | 2008-08-17T13:41:11.327 | null | null | 1,491 | null |
13,622 | 2 | null | 13,537 | 3 | null | Another alternative is to create a bytecode machine for your language (or use an existing one if it's features aren't very unusual) and write a compiler to bytecode, either in the bytecode, or in your desired language using another intermediate - such as a parser toolkit which outputs the AST as XML, then compile the X... | null | CC BY-SA 2.5 | null | 2008-08-17T13:21:16.500 | 2008-08-17T13:21:16.500 | null | null | 1,527 | null |
13,643 | 2 | null | 12,516 | 2 | null | > I won't give away the answer, but a
Standard Bad Solution involves the use
of a switch or case statment (or just
good old-fashioned cascaded-ifs). A
Slightly Better Solution involves
using a table of function pointers,
and the Probably Best Solution
involves using polymorphism.
The last twenty years o... | null | CC BY-SA 2.5 | null | 2008-08-17T13:59:12.630 | 2008-08-20T18:09:15.837 | 2008-08-20T18:09:15.837 | 1,527 | 1,527 | null |
13,641 | 2 | null | 13,599 | 0 | null | I found it best to define your enum values with an under score so ThisIsValueA would be This_Is_Value_A then you can just do a enumValue.toString().Replace("_"," ") where enumValue is your varible.
| null | CC BY-SA 2.5 | null | 2008-08-17T13:57:07.190 | 2008-08-17T13:57:07.190 | null | null | 33 | null |
13,647 | 1 | 13,663 | null | 7 | 3,680 | I am used to writing C# Windows applications. However, I have some free hosted PHP webspace that I would like to make use of. I have a basic understanding of PHP but have never used its object-oriented capabilities.
Is there an easy way to convert C# classes to PHP classes or is it just not possible to write a fully ob... | Is there an easy way to convert C# classes to PHP? | CC BY-SA 4.0 | null | 2008-08-17T14:16:50.833 | 2021-07-06T22:15:52.707 | 2021-07-06T22:15:52.707 | 13,176,802 | 33 | [
"c#",
"php"
] |
13,639 | 2 | null | 1,241 | 8 | null | Using asynchronous communication is totally possible in single thread!
There is a common design pattern in network software development called the reactor pattern ([look at this book](http://www.amazon.fr/Pattern-Oriented-Software-Architecture-Concurrent-Networked/dp/0471606952/ref=sr_1_9?ie=UTF8&s=english-books&qid=... | null | CC BY-SA 2.5 | null | 2008-08-17T13:53:04.733 | 2008-08-17T13:53:04.733 | null | null | 1,578 | null |
13,650 | 2 | null | 8,348 | 0 | null | Take a look at this blog post from Krzystof: [http://blogs.msdn.com/kcwalina/archive/2008/07/17/ExceptionalError.aspx](http://blogs.msdn.com/kcwalina/archive/2008/07/17/ExceptionalError.aspx)
Exceptions should be used for communicating error conditions, but they shouldn't be used as control logic (especially when ther... | null | CC BY-SA 2.5 | null | 2008-08-17T14:38:19.963 | 2008-08-17T14:38:19.963 | null | null | 1,559 | null |
13,649 | 2 | null | 12,368 | 6 | null | Take a look at this [article](http://www.codeproject.com/KB/cs/idisposable.aspx)
Implementing the Dispose pattern, IDisposable, and/or a finalizer has absolutely nothing to do with when memory gets reclaimed; instead, it has everything to do with telling the GC to reclaim that memory. When you call Dispose() you are ... | null | CC BY-SA 3.0 | null | 2008-08-17T14:22:44.940 | 2011-08-24T09:53:31.593 | 2011-08-24T09:53:31.593 | null | 1,559 | null |
13,655 | 1 | 13,657 | null | 4 | 2,189 | Is it possible in .NET to list files on a remote location like an URL? Much in the same way the System.IO classes work. All I need is the URLs to images that are on a remote server.
| C# .NET listing contents of remote files | CC BY-SA 2.5 | null | 2008-08-17T14:48:00.350 | 2009-01-25T21:46:28.160 | null | null | null | [
".net"
] |
13,658 | 2 | null | 13,647 | 0 | null | I don't know about a tool to automate the process but you could use the Reflexion API to browse your C# class and generate a corresponding PHP class.
Of course, the difficulty here is to correctly map C# types to PHP but with enough unit testing, you should be able to do what you want.
I advice you to go this way bec... | null | CC BY-SA 2.5 | null | 2008-08-17T14:57:13.823 | 2008-08-17T14:57:13.823 | null | null | 268 | null |
13,651 | 2 | null | 13,615 | 0 | null | I found this [link](http://www.cambiaresearch.com/c4/52a7e5fe-c7fc-49ab-b21d-37e6194687f3/Convert-Integer-To-Enum-Instance-in-csharp.aspx) that answers it quite well. It uses:
```
(ENUMTYPE)Enum.ToObject(typeof(ENUMTYPE), INT)
```
| null | CC BY-SA 3.0 | null | 2008-08-17T14:40:04.500 | 2016-02-16T13:17:43.680 | 2016-02-16T13:17:43.680 | 4,519,059 | 212 | null |
13,663 | 2 | null | 13,647 | 2 | null | It is entirely possible to write a PHP application almost entirely in an object-oriented methodology. You will have to write some procedural code to create and launch your first object but beyond that there are plenty of MVC frameworks for PHP that are all object-oriented. One that I would look at as an example is [Cod... | null | CC BY-SA 2.5 | null | 2008-08-17T15:05:51.170 | 2008-08-17T15:05:51.170 | null | null | 200 | null |
13,659 | 2 | null | 13,594 | 3 | null | If you are programming in javascript the best advice I can give is to use a javascript library instead of trying to roll your own. The libraries are well tested, and the corner cases are more likely to have been encountered.
Scriptalicious - [http://script.aculo.us/](http://script.aculo.us/)
jQuery - [http://jquery.c... | null | CC BY-SA 2.5 | null | 2008-08-17T14:58:25.257 | 2008-08-17T14:58:25.257 | null | null | 1,611 | null |
13,618 | 2 | null | 13,607 | 2 | null | I wouldn't use OpenGL for the GUI unless you are planning for hardware accelerated and/or 3D effects that you don't think you would get with a more traditional GUI toolkit (e.g [Qt](http://trolltech.com/), [wxWidgets](http://www.wxwidgets.org/), [GTK](http://www.gtk.org/), etc). If you just need a quick simple GUI for ... | null | CC BY-SA 2.5 | null | 2008-08-17T13:18:18.673 | 2008-08-19T13:40:35.133 | 2017-05-23T10:30:43.187 | -1 | 1,491 | null |
13,648 | 2 | null | 13,647 | 3 | null | A huge problem would be to replicate the .Net Framework in PHP if the C# class usses it.
| null | CC BY-SA 2.5 | null | 2008-08-17T14:20:42.137 | 2008-08-17T14:20:42.137 | null | null | null | null |
13,668 | 2 | null | 13,550 | 1 | null | We use a CASE tool at my current company for code generation and we are trying to move away from it.
The benefits that it brings - a graphical representation of the code making components 'easier' to pick up for new developers - are outweighed by the disadvantges in my opinion.
Those main disadvantages are:
1. We c... | null | CC BY-SA 2.5 | null | 2008-08-17T15:21:50.513 | 2008-08-17T15:21:50.513 | null | null | 849 | null |
13,662 | 2 | null | 11,915 | 34 | null | I agree with Haacked. I am currently implementing my site/blog using the MVC framework and I went with the simple approach of creating a new View for RSS:
```
<%@ Page ContentType="application/rss+xml" Language="C#" AutoEventWireup="true" CodeBehind="PostRSS.aspx.cs" Inherits="rr.web.Views.Blog.PostRSS" %><?xml versio... | null | CC BY-SA 2.5 | null | 2008-08-17T15:05:47.177 | 2010-01-30T02:25:24.990 | 2010-01-30T02:25:24.990 | 653 | 653 | null |
13,673 | 2 | null | 13,550 | 0 | null | Just a couple questions for you:
How much productivity do you gain compared to the control that you use?
How testable and reliant is the code you create?
How well can you implement a new pattern into your design?
I can't imagine that there is a CASE out there that I could write a test first and then use a CASE to gen... | null | CC BY-SA 2.5 | null | 2008-08-17T15:32:34.517 | 2008-08-17T15:32:34.517 | null | null | 1,614 | null |
13,657 | 2 | null | 13,655 | 3 | null | No, unless you have more control over that web-server
Here are possible solutions...
1. You will need server-side script that will do it locally and output this list in your preferred format.
2. Most of the web-servers implement default file-browsing pages, so you could theoretically parse those but this solution ... | null | CC BY-SA 2.5 | null | 2008-08-17T14:52:09.513 | 2008-08-17T15:01:36.250 | 2008-08-17T15:01:36.250 | 275 | 275 | null |
13,685 | 2 | null | 12,103 | 3 | null | As a counterpoint to Greg's answer, you could misuse grep:
```
@filtered = grep {s/ //g; 1} @outdata;
```
| null | CC BY-SA 2.5 | null | 2008-08-17T15:51:55.073 | 2008-08-17T15:51:55.073 | null | null | 1,612 | null |
13,680 | 2 | null | 13,620 | 18 | null | @Adam's test used
```
"these are " . $foo
```
note that the following is even faster:
```
'these are ' . $foo;
```
this is due to the fact, that a double quoted "string" gets evaluated, where a single quoted 'string' is just taken as is...
| null | CC BY-SA 2.5 | null | 2008-08-17T15:44:57.443 | 2008-08-17T15:44:57.443 | null | null | 1,532 | null |
13,562 | 2 | null | 12,319 | 5 | null | You just want to open a file handle using a path that may contain Unicode characters, right? Just pass the path in to `fopen`.
- If the path came from the stock Mac OS X frameworks (for example, an Open panel whether Carbon or Cocoa), you won't need to do any conversion on it and will be able to use it as-is.- If yo... | null | CC BY-SA 2.5 | null | 2008-08-17T08:43:14.877 | 2008-08-17T08:51:44.267 | 2008-08-17T08:51:44.280 | 714 | 714 | null |
13,677 | 2 | null | 10,533 | 1 | null | As a fairly simple modification to Rudd's version,
```
/^x=(.+) and y=([^ ]+)(?: and (.*))?/
```
will allow you to use $1, $2 and $3 (the ?: makes it a noncapturing group), and will ensure that the string starts with "x=" rather than allowing a "not_x=" to match
If you have better knowledge of what the x and y valu... | null | CC BY-SA 2.5 | null | 2008-08-17T15:39:50.480 | 2008-08-17T15:39:50.480 | null | null | 1,612 | null |
13,690 | 2 | null | 11 | 11 | null | You can reduce the server-side load by performing this logic client-side. View source on some Digg pages for reference. They have the server emit an epoch time value that gets processed by Javascript. This way you don't need to manage the end user's time zone. The new server-side code would be something like:
```
publ... | null | CC BY-SA 4.0 | null | 2008-08-17T15:56:26.810 | 2018-09-27T09:13:12.363 | 2018-09-27T09:13:12.363 | 5,407,188 | null | null |
13,693 | 2 | null | 13,678 | 1 | null | I think that graphical languages might be the language of the future..... for all those adhoc MS Access developers out there. There will always be a spot for the purely textual coders.
Personally, I've got to ask what is the real fun of building a robot if it's all done for you? If you just drop a 'find the red ball' ... | null | CC BY-SA 2.5 | null | 2008-08-17T15:59:08.287 | 2008-08-17T15:59:08.287 | null | null | 1,614 | null |
13,697 | 2 | null | 13,599 | 12 | null | The .ToString on Enums is relatively slow in C#, comparable with GetType().Name (it might even use that under the covers).
If your solution needs to be very quick or highly efficient you may be best of caching your conversions in a static dictionary, and looking them up from there.
---
A small adaptation of @Leon... | null | CC BY-SA 2.5 | null | 2008-08-17T16:05:16.417 | 2008-08-17T16:11:11.007 | 2008-08-17T16:11:11.007 | 905 | 905 | null |
13,688 | 2 | null | 13,678 | 6 | null | This doesn't answer you question directly, but you may want to consider a third option of mixing in an interpreted language. [Lua](http://www.lua.org/), for example, is [already](http://luaforge.net/projects/lrt/) [used](http://www.hougaard.com/robot/) in the robotics field. It's fast, light-weight and can be configure... | null | CC BY-SA 2.5 | null | 2008-08-17T15:55:24.627 | 2008-08-17T15:55:24.627 | null | null | 1,491 | null |
13,665 | 2 | null | 13,620 | 47 | null | Well, as with all "What might be faster in real life" questions, you can't beat a real life test.
```
function timeFunc($function, $runs)
{
$times = array();
for ($i = 0; $i < $runs; $i++)
{
$time = microtime();
call_user_func($function);
$times[$i] = microtime() - $time;
}
return array_sum($ti... | null | CC BY-SA 3.0 | null | 2008-08-17T15:10:24.843 | 2015-02-26T12:28:53.290 | 2015-02-26T12:28:53.290 | 1,045,444 | 1,200 | null |
13,698 | 1 | 13,777 | null | 2 | 4,160 | I've seen it mentioned in many blogs around the net, but I believe it shoud be discussed here.
What can we do when we have an MVC framework (I am interested in ZEND) in PHP but our host does not provide mod_rewrite?
Are there any "short-cuts"? Can we transfer control in any way (so that a mapping may occur between page... | php Zend / MVC without mod_rewrite | CC BY-SA 2.5 | null | 2008-08-17T16:06:03.827 | 2021-07-07T14:06:19.787 | 2011-03-31T03:28:56.323 | 168,868 | 1,622 | [
"php",
"model-view-controller",
"zend-framework"
] |
13,707 | 2 | null | 13,594 | 0 | null | The one that really annoys me is IE's broken document.getElementById javascript function - in most browsers this will give you something that has the id you specify, IE is happy to give you something that has the value in the name attribute, even if there is something later in the document with the id you asked for.
| null | CC BY-SA 2.5 | null | 2008-08-17T16:28:13.720 | 2008-08-17T16:28:13.720 | null | null | 1,612 | null |
13,703 | 2 | null | 13,678 | 4 | null | There is a published study of the topic hosted by National Instruments:
[A Study of Graphical vs. Textual Programming for Teaching DSP](http://zone.ni.com/devzone/cda/tut/p/id/3798)
It specifically looks at LabVIEW versus MATLAB (as opposed to C).
| null | CC BY-SA 2.5 | null | 2008-08-17T16:18:10.947 | 2008-08-17T16:18:10.947 | null | null | 1,491 | null |
13,706 | 2 | null | 13,704 | 3 | null | Wow, I'm not sure we're talking migration here anymore - the difference is more like re-writing!
---
As others have also said, MVC is a whole new way to build web apps - most of your presentation code won't carry across.
However, if you are re-writing in MVC what you already have is a good prototype. Your problem... | null | CC BY-SA 2.5 | null | 2008-08-17T16:25:40.573 | 2008-09-20T07:27:44.160 | 2008-08-17T17:51:13.053 | 905 | 905 | null |
13,712 | 2 | null | 13,708 | 1 | null | Here's the WordPress doc on [Theme Development](http://codex.wordpress.org/Theme_Development)
| null | CC BY-SA 2.5 | null | 2008-08-17T16:42:28.527 | 2008-08-17T16:42:28.527 | null | null | 305 | null |
13,714 | 2 | null | 13,704 | 0 | null | My opinion is that the two technologies are so different that if you have tightly coupled code in the original Web Form applications that the best approach is to start by picking one of them and converting it by creating a new ASP.NET MVC application and ripping out code into their respective layers. Which will put yo... | null | CC BY-SA 2.5 | null | 2008-08-17T16:49:18.980 | 2008-09-20T07:27:44.160 | null | null | 1,117 | null |
13,704 | 1 | 13,726 | null | 5 | 731 | ASP.NET MVC has been [discussed](https://stackoverflow.com/questions/tagged/mvc) on this forum a few times. I'm about to do a large of several websites from classic ASP/ASP.NET WebForms to ASP.NET MVC and was wondering what kind of advice those of you with experience in both technologies have.
What I have: a typical ... | Suggestions for Migrating from ASP.NET WebForms to ASP.NET MVC? | CC BY-SA 2.5 | null | 2008-08-17T16:18:54.097 | 2008-09-20T07:27:44.130 | 2017-05-23T12:08:36.867 | -1 | null | [
".net",
"asp.net",
"asp.net-mvc",
"webforms"
] |
13,716 | 2 | null | 12,890 | 0 | null | I've been toying with composite indexes and have seen some real benefits...maybe I'll setup some tests to see if that can save me here..at least for a little longer.
| null | CC BY-SA 2.5 | null | 2008-08-17T16:52:00.257 | 2008-08-17T16:52:00.257 | null | null | 1,430 | null |
13,718 | 1 | 13,735 | null | 2 | 4,701 | I want to run a weekly batch process in an asp.net page. How can that be done?
Thanks
| How to schedule a batch process in asp.net | CC BY-SA 2.5 | 0 | 2008-08-17T16:54:57.190 | 2009-09-21T18:38:30.013 | null | null | 1,013 | [
"asp.net"
] |
13,713 | 2 | null | 13,708 | 4 | null | The Wordpress part is the easy bit. That's basically taking your static HTML pages then converting them to PHP and inserting the Wordpress tags to pull content from the database. In some places these tags will be in a loop, e.g. for a list of pages.
The most difficult part is the design. You should identify the page t... | null | CC BY-SA 2.5 | null | 2008-08-17T16:46:44.337 | 2008-08-17T16:46:44.337 | null | null | 1,043 | null |
13,720 | 2 | null | 5,134 | 2 | null | Check [CaptainHook](https://sourceforge.net/projects/captainhook/), "a simple plugin framework for writing Subversion hooks using .NET".
| null | CC BY-SA 2.5 | null | 2008-08-17T16:55:35.380 | 2008-08-17T16:55:35.380 | null | null | 1,600 | null |
13,723 | 2 | null | 13,718 | 2 | null | Consider using the [Cache](http://www.codeproject.com/KB/aspnet/ASPNETService.aspx).
| null | CC BY-SA 2.5 | null | 2008-08-17T16:56:26.313 | 2008-08-17T16:56:26.313 | null | null | 307 | null |
13,678 | 1 | 13,746 | null | 35 | 9,540 | I am part of a high school robotics team, and there is some debate about which language to use to program our robot. We are choosing between C (or maybe C++) and LabVIEW. There are pros for each language.
C(++):
- - - -
LabVIEW
- - - - -
This is a very difficult decision for us, and we've been debating for a w... | Textual versus Graphical Programming Languages | CC BY-SA 2.5 | 0 | 2008-08-17T15:39:57.560 | 2013-09-14T12:42:27.133 | 2010-03-06T15:26:45.513 | 69,742 | 1,615 | [
"robotics",
"labview",
"graphical-language"
] |
13,730 | 2 | null | 13,725 | 18 | null | 64-bit is actually the raison d'être for NSInteger and NSUInteger; before 10.5, those did not exist. The two are simply defined as longs in 64-bit, and as ints in 32-bit:
```
#if __LP64__ || NS_BUILD_32_LIKE_64
typedef long NSInteger;
typedef unsigned long NSUInteger;
#else
typedef int NSInteger;
typedef unsigned int ... | null | CC BY-SA 3.0 | null | 2008-08-17T17:09:21.343 | 2013-10-24T16:32:29.507 | 2013-10-24T16:32:29.507 | 1,600 | 1,600 | null |
13,719 | 2 | null | 13,708 | 8 | null | I think that the best way to learn is to look at how other people construct their themes. The first one to start one is the Default Kubrick theme that is included in the standard WordPress install. It has all of the basics and will show you some advanced techniques like including sidebar widgets. Next, in conjunction w... | null | CC BY-SA 2.5 | null | 2008-08-17T16:55:33.820 | 2008-08-17T16:55:33.820 | null | null | 51 | null |
13,725 | 1 | 13,742 | null | 48 | 24,018 | `NSInteger`/`NSUInteger` are Cocoa-defined replacements for the regular built-in types.
Is there any benefit to using the NS* types over the built-ins? Which do you prefer and why? Are `NSInteger` and `int` the same width on 32-bit / 64-bit platforms?
| In Cocoa do you prefer NSInteger or int, and why? | CC BY-SA 3.0 | 0 | 2008-08-17T17:01:45.150 | 2013-10-24T16:32:29.507 | 2012-07-08T21:38:30.727 | 603,977 | 1,043 | [
"objective-c",
"cocoa",
"types"
] |
13,708 | 1 | 13,719 | null | 13 | 2,692 | What are the best resources for Wordpress theme-development? I am currently in the phase of starting my own blog, and don't want to use one of the many free themes. I already have a theme for my website, so I want to read about best-practices.
Any advice on how to get started would be very welcome :)
---
I have ... | Resources on wordpress theme-development | CC BY-SA 3.0 | 0 | 2008-08-17T16:35:15.920 | 2016-12-04T13:58:53.320 | 2016-12-04T13:58:53.320 | 1,977,847 | 1,542 | [
"wordpress",
"themes"
] |
13,735 | 2 | null | 13,718 | 3 | null | > Is there any known drawbacks with the
solution?
[Here is the blog post](https://blog.stackoverflow.com/2008/07/easy-background-tasks-in-aspnet/) in which Jeff Atwood discusses this approach. As with most of Jeff's post, the meat is in the comments where the pros and cons have been discussed in extreme detail by a lar... | null | CC BY-SA 4.0 | null | 2008-08-17T17:15:30.537 | 2008-08-17T17:15:30.537 | 2021-01-18T12:38:11.483 | -1 | 541 | null |
13,731 | 1 | null | null | 3 | 923 | >
[What are the most important functional differences between C# and VB.NET?](https://stackoverflow.com/questions/11632/what-are-the-most-important-functional-differences-between-c-and-vb-net)
Other than syntax, what are the major differences between C# and vb.net?
| Differences Between C# and VB.net | CC BY-SA 2.5 | 0 | 2008-08-17T17:09:25.337 | 2011-01-03T02:10:09.283 | 2017-05-23T12:04:26.480 | -1 | 1,632 | [
"c#",
"vb.net"
] |
13,741 | 2 | null | 1,623 | 0 | null | > Separating your source code into
multiple projects makes only sense if
you...
... More developers involved
and you want to treat their work as
consumable black box. (not very
recommended) ...
Why isn't this recommended? I've found it a very useful way to manage an application with several devs working... | null | CC BY-SA 2.5 | null | 2008-08-17T17:19:51.993 | 2008-08-17T17:19:51.993 | null | null | 1,616 | null |
13,726 | 2 | null | 13,704 | 2 | null | > Any pointers, tips, tricks, or
gotchas to be aware of?
Well, I think you're probably a little ways away from thinking about tricks & gotchas :) As I'm sure you're aware, ASP.NET MVC is not some new version of ASP.NET, but a totally different paradigm from ASP.NET, you won't be migrating, you'll be initiating a bra... | null | CC BY-SA 2.5 | null | 2008-08-17T17:01:50.593 | 2008-09-20T07:27:44.160 | 2008-08-17T17:07:19.413 | 541 | 541 | null |
13,729 | 2 | null | 13,594 | 8 | null |
Web developers have already compiled some pretty comprehensive lists; I think it's better to compile a list of resources than to duplicate those lists.
- [http://www.positioniseverything.net/](http://www.positioniseverything.net/)- [http://www.richinstyle.com/bugs/table.html](http://www.richinstyle.com/bugs/table.ht... | null | CC BY-SA 2.5 | null | 2008-08-17T17:08:10.503 | 2009-04-25T14:32:53.607 | 2017-05-23T12:01:23.407 | -1 | 5 | null |
13,739 | 2 | null | 13,698 | 0 | null | mod_rewrite is almost essential in today's hosting environment..but unfortunately not everyone got the message.
Lots of the large php programs (I'm thinking magento, but most can cope) have a pretty-url fall back mode for when mod_rewrite isn't available.
URLs end up looking like www.site.com/index.php?load-this-page... | null | CC BY-SA 2.5 | null | 2008-08-17T17:18:12.293 | 2008-08-17T17:18:12.293 | null | null | 1,430 | null |
13,738 | 2 | null | 4,072 | 2 | null | This only happens with conflicts - basically svn tried to merge the change in, but (roughly speaking) saw the change as:
Add
```
2008-08-06 Mike Stone <myemail>
* changed_file: Details.
```
before
```
2008-08-06 Someone Else <their_email>
```
And it couldn't find the Someone Else line while doing the merge,... | null | CC BY-SA 2.5 | null | 2008-08-17T17:17:46.193 | 2008-08-17T17:17:46.193 | null | null | 1,612 | null |
13,742 | 2 | null | 13,725 | 58 | null | The way I understand it is that NSInteger et al. are architecture safe versions of the corresponding C types. Basically their size vary depending on the architecture, but NSInteger, for example, is guaranteed to hold any valid pointer for the current architecture.
Apple recommends that you use these to work with OS X ... | null | CC BY-SA 2.5 | null | 2008-08-17T17:20:31.803 | 2008-08-17T17:20:31.803 | null | null | 1,109 | null |
13,747 | 2 | null | 13,745 | -1 | null | Time to branch your repository. That's the nice part about version control, you can create new branches without totaling the old ones.
| null | CC BY-SA 2.5 | null | 2008-08-17T17:24:54.433 | 2008-08-17T17:24:54.433 | null | null | 1,370 | null |
13,744 | 2 | null | 13,708 | 2 | null | [Here's another good article on the topic](http://lorelle.wordpress.com/2005/09/28/designing-a-wordpress-theme-from-scratch/). And of course, [there are many more like it](http://www.google.com/search?q=designing+wordpress+theme). I have reviewed this particular article in the past though, and found it to be a good, de... | null | CC BY-SA 2.5 | null | 2008-08-17T17:21:56.483 | 2008-08-17T17:21:56.483 | null | null | 541 | null |
13,745 | 1 | 13,756 | null | 13 | 1,843 | Is there any good way to deal with the class renaming refactor from Resharper when the file is under source control and TortoiseSVN is the client. I have am trying VisualSVN right now but I haven't had the need to rename anything recently. I don't want to change our repository just to try this out.
Also not sure if ... | Resharper and TortoiseSVN | CC BY-SA 2.5 | 0 | 2008-08-17T17:22:26.590 | 2016-03-02T12:45:09.947 | 2014-10-21T09:07:45.617 | 761,095 | 1,629 | [
"svn",
"tortoisesvn",
"resharper",
"visualsvn",
"ankhsvn"
] |
13,755 | 2 | null | 1,623 | 7 | null | Separating features into projects is often a YAGNI architecture optimization. How often have you reused those separate projects, really? If it's not a frequent occurrence, you're complicating your development, build, deployment, and maintenance for theoretical reuse.
I much prefer separating into folders (using approp... | null | CC BY-SA 2.5 | null | 2008-08-17T17:35:22.070 | 2008-08-17T17:35:22.070 | null | null | 5 | null |
13,751 | 1 | null | null | 1,383 | 320,045 | How can I permanently enable line numbers in IntelliJ IDEA?
| How can I permanently enable line numbers in IntelliJ? | CC BY-SA 3.0 | 0 | 2008-08-17T17:31:38.380 | 2020-04-24T08:51:53.777 | 2018-03-27T01:26:14.737 | 3,067,217 | null | [
"intellij-idea"
] |
13,759 | 2 | null | 13,430 | 4 | null | What Dale Ragan said; it installed flawlessly on our Windows Server 2008 machine, including the Dashboard running on IIS 7. Just give it a shot; should work fine.
| null | CC BY-SA 2.5 | null | 2008-08-17T17:38:12.783 | 2008-08-17T17:38:12.783 | null | null | 1,600 | null |
13,756 | 2 | null | 13,745 | 12 | null | TortoiseSVN 1.5 has a neat hidden feature on the check in window:
Select a missing file and a new file and right-click. One of the options will be "fix move".
I tend to refactor away, and then use this to fix any files where the name has changed.
| null | CC BY-SA 2.5 | null | 2008-08-17T17:35:59.167 | 2016-03-02T12:45:09.947 | 2016-03-02T12:45:09.947 | 905 | 905 | null |