text stringlengths 8 267k | meta dict |
|---|---|
Q: How to access the previous/next element in a for loop? Is there a way to access a list's (or tuple's, or other iterable's) next or previous element while looping through it with a for loop?
l = [1, 2, 3]
for item in l:
if item == 2:
get_previous(l, item)
A: I know this is old, but why not just use enum... | {
"language": "en",
"url": "https://stackoverflow.com/questions/323750",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "51"
} |
Q: What's the most efficient way to remember read/unread status across multiple items? For example, let's take the format of a forum, where we have multiple users and multiple threads. Say this forum wants to track which users have read which threads and, say, use that information to mark which threads are unread when ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/323758",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "2"
} |
Q: Foreign key from one app into another in Django I'm wondering if it's possible to define a foreign key in a models.py file in Django that is a reference to a table in another app?
In other words, I have two apps, called cf and profiles, and in cf/models.py I have (amongst other things):
class Movie(models.Model):
... | {
"language": "en",
"url": "https://stackoverflow.com/questions/323763",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "121"
} |
Q: Sources for visual explanations? Does anyone has sources for visual explanations of algorithms (or maths) that is even more expressive, more intuitive, maybe aesthetically appealing ? Or, animations of algorithms?
A: Here's one for sorting algorithms. It gives some nice animations to see how each type works their w... | {
"language": "en",
"url": "https://stackoverflow.com/questions/323769",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "3"
} |
Q: How can I make a CListCtrl keep its scrollbar? In MFC, a CListBox has a "disable no scroll" property. When you set it to true, the vertical scrollbar is always there, no matter how many items you have. How can I do the same thing with CListCtrl?
A: The standard control does not seem to support your desired behavi... | {
"language": "en",
"url": "https://stackoverflow.com/questions/323774",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: Typed DataSets with XML data sources and schemas I've written an XML Schema file by hand (not using the DataSet Designer in VS) and a corresponding XML file containing structured data to be read in.
I ran the xsd.exe program to generate a Typed DataSet class; on the whole it looks fine to begin with (ignoring how it... | {
"language": "en",
"url": "https://stackoverflow.com/questions/323778",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: Running a junit4 test with junitperf It' possible to use Junitperf with junit4?
I've a simplet Junit4 test class with several tests and I want to do a TimedTest on single test of that class. How can I do that?
To be more clear my Junit4 class is something like:
public class TestCitta {
@Test
public void tes... | {
"language": "en",
"url": "https://stackoverflow.com/questions/323782",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "2"
} |
Q: Autotools : how to set global compilation flag I have a project with several sources directories :
src/A
/B
/C
In each, the Makefile.am contains
AM_CXXFLAGS = -fPIC -Wall -Wextra
How can avoid repeating this in each source folder ?
I tried to modifiy src/Makefile.am and the configure.in, but without succe... | {
"language": "en",
"url": "https://stackoverflow.com/questions/323790",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "19"
} |
Q: How to generate running time graph for my Java program Hi I want to generate running time graphs on my java program. Is there any program which makes it?
A: So, if the X-axis is time, what do want on the Y-axis?
If its memory, then you could use something jconsole or jvisualvm
A: When you mean the time each metho... | {
"language": "en",
"url": "https://stackoverflow.com/questions/323791",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: C++ Pointers / Lists Implementation
Write a class ListNode which has the following properties:
*
*int value;
*ListNode *next;
Provide the following functions:
*
*ListNode(int v, ListNode *l)
*int getValue();
*ListNode* getNext();
*void insert(int i);
*bool listcontains(int j);
Write a program which asks ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/323816",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: How to access the notes field on a GroupPrincipal object I query all security groups in a specific domain using
PrincipalSearchResult<Principal> results = ps.FindAll();
where ps is a PrincipalSearcher.
I then need to iterate the result (casting it to a GroupPrincipal first ) and locate the ones that contains a spe... | {
"language": "en",
"url": "https://stackoverflow.com/questions/323817",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: Documentation of software design and architecture What are the best practices and software tools for documenting software design and architecture for
*
*PC based applications based on Java
or .NET?
*Embedded Applications based on VxWorks or Embedded Linux or Windows CE?
One tool I have in mind is Enterprise Arc... | {
"language": "en",
"url": "https://stackoverflow.com/questions/323823",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "2"
} |
Q: How to find out if there is data to be read from stdin on Windows in Python? This code
select.select([sys.stdin], [], [], 1.0)
does exactly what I want on Linux, but not in Windows.
I've used kbhit() in msvcrt before to see if data is available on stdin for reading, but in this case it always returns 0. Additional... | {
"language": "en",
"url": "https://stackoverflow.com/questions/323829",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "8"
} |
Q: WindowsPrincipal.IsInRole and universal vs. global active directory groups Does anybody know how to make WindowsPrincipal.IsInRole("domain\role") work with active directory universal groups?
Let's say the current user is a member of a group called Role in a domain called domain, and that the Role group is a Global g... | {
"language": "en",
"url": "https://stackoverflow.com/questions/323831",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "5"
} |
Q: How should I get rid of TFS Branches properly? I am wondering how I should properly get rid of branches that no longer have any purpose. Right now even if i delete them and commit they are still listed as branches in the properties windows for a particular branching root (directory). If I select merge I don't get an... | {
"language": "en",
"url": "https://stackoverflow.com/questions/323834",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "34"
} |
Q: C# comments on closing {} I've been working a little with DevExpress CodeRush and Refactor! Pro this week, and I picked up a commentor plug-in that will automatically generate comments as you type code.
I don't want to go into how good a job it does of picking out basic meaning (pretty good, actually) but it's defau... | {
"language": "en",
"url": "https://stackoverflow.com/questions/323837",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "3"
} |
Q: MySQL Table Design for a Questionnaire I am fairly new to MySQL and have a project in which I need to design a database that will store responses from an online questionnaire. Reports will need to be written from the data. Does anyone have any tips on what type of fields to use? The questions will either have a Y... | {
"language": "en",
"url": "https://stackoverflow.com/questions/323842",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: Optimizing unions I'm having trouble trying to optimize the following query for sql server 2005. Does anyone know how could I improve it. Each one of the tables used there have about 40 million rows each. I've tried my best trying to optimize it but I manage to do the exact opposite.
Thanks
SELECT
cos
... | {
"language": "en",
"url": "https://stackoverflow.com/questions/323857",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: How to analyse .exe parameters inside the program? I have a program that can have a lot of parameters (we have over +30 differents options).
Example:
myProgram.exe -t alpha 1 -prod 1 2 -sleep 200
This is 3 Commands (from command pattern object at the end) that each contain some parameters. Inside the code we parse a... | {
"language": "en",
"url": "https://stackoverflow.com/questions/323866",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "4"
} |
Q: how to show/hide SIP on Pocket PC I have the following problem:
I open the dialog, open the SIP keyboard to fill the form and then minimize the SIP. Then when I close the current dialog and return to the main dialog the SIP keyboard appears again. Does anyone know how could I show/hide SIP keyboard programatically o... | {
"language": "en",
"url": "https://stackoverflow.com/questions/323874",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "3"
} |
Q: How to trace WCF message size? I'm fooling around with WCF, and would like to see how many messages I send/receive, and how large these messages are.
I tried activated WCF tracing, and ended up with a real huge trace file, but I found no way to extract the simple message size from this.
There sure must be some way t... | {
"language": "en",
"url": "https://stackoverflow.com/questions/323888",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "11"
} |
Q: How to find duplicate rows in a join text file I have recently converted 10 JavaScript files into one file, which I then run a JavaScript compiler on. I just had a bug where I had reused a function name.
Is there a tool to check for duplicate rows/function names in the combined file?
Or should I create a little prog... | {
"language": "en",
"url": "https://stackoverflow.com/questions/323901",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: removing text layer and replacing with image I have this code, which works fine, but I would like to be able to make it so when an image appears the text layer disapears, and there would be a link to bring the xt back and remove the image. How would I do this..., something to do with changing isibility and overlayin... | {
"language": "en",
"url": "https://stackoverflow.com/questions/323907",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: How do I self-host a TCP-based WCF service inside a Windows Service? I am trying to self-host a TCP-based WFC service inside a Windows Service. The Windows Service is a wrapper for performing 2 jobs:
*
*hosting a TCP-based WCF service (note the Windows Service is a simple service)
*running other Windows Services... | {
"language": "en",
"url": "https://stackoverflow.com/questions/323913",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "3"
} |
Q: Inherited class quagmire, how to make this maintainable code I want to create maintainable code, but this inheritance situation is causing me problems.
The issue is with my 2nd database helper class named InitUserExtension.
Since UserExtension inherits from User, I have to make sure that I mirror any changes in my I... | {
"language": "en",
"url": "https://stackoverflow.com/questions/323922",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: Event handling in Visual C++ There are two pictureboxes with two different images.
If I click on one picture box, the image in it should be cleared.
To make the matters worse, both of the picture boxes have only one common event handler.
How can I know which picturebox generated the event? I would appreciate source ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/323928",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: Is there such a thing as a "good" memory leak?
Possible Duplicate:
Are memory leaks ever ok?
I read somewhere that there are special cases when memory leaks are needed and actually a good thing in some rare circumstances. But i can't remember what was it exactly!
Does anyone know or remember such an argument?
Tha... | {
"language": "en",
"url": "https://stackoverflow.com/questions/323938",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "2"
} |
Q: Webservice Authentication I'm working on a webservice + AJAX interface, and I'm worried about authentication. This moment I'm passing username and password to the webservice as arguments, but I fear that this approach is highly insecure. I was told that ssl could solve my problem, but I want more alternatives.
My we... | {
"language": "en",
"url": "https://stackoverflow.com/questions/323939",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: Can a java fixedThreadPool be used by multiple threads I have a webservice that does multiple small calculations before returning the result. I want to use the ExecutorService provided by Executors.newFixedThreadPool() as a way to implement the Master - Worker pattern (ie. call invokeAll and let the thread wait for ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/323945",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: How to combine two jQuery results How do you combine two jQuery search results? eg:
var $allFoos = $('.foo'),
$allBars = $('.bar')
$allFoosAndBars = $allFoos + $allBars;
Obviously, I just made up that last line, but I hope it makes it sorta clear what I mean. To be clear, the example is greatly simplified, ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/323955",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "167"
} |
Q: How do I edit /etc/sudoers from a script? I need to edit /etc/sudoers from a script to add/remove stuff from white lists.
Assuming I have a command that would work on a normal file, how could I apply it to /etc/sudoers?
Can I copy and modify it, then have visudo replace the original with the modified copy? By provid... | {
"language": "en",
"url": "https://stackoverflow.com/questions/323957",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "146"
} |
Q: Is there any way to kill a Thread? Is it possible to terminate a running thread without setting/checking any flags/semaphores/etc.?
A: It is generally a bad pattern to kill a thread abruptly, in Python, and in any language. Think of the following cases:
*
*the thread is holding a critical resource that must be cl... | {
"language": "en",
"url": "https://stackoverflow.com/questions/323972",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "955"
} |
Q: .NET Regular Expressions in Infinite Cycle I'm using .NET Regular Expressions to strip HTML code.
Using something like:
<title>(?<Title>[\w\W]+?)</title>[\w\W]+?<div class="article">(?<Text>[\w\W]+?)</div>
This works for 99% of the time, but sometimes, when parsing...
Regex.IsMatch(HTML, Pattern)
The parser just b... | {
"language": "en",
"url": "https://stackoverflow.com/questions/323973",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: Rails JOIN TABLES i'm trying to use the GeoKit plugin to calculate the distance between 2 points. So the idea is, i do a search for an article, and the results i want to order by distance. So i have a form where I enter the article (that im looking for) and my address. Then rails must find all articles that match wi... | {
"language": "en",
"url": "https://stackoverflow.com/questions/323977",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "2"
} |
Q: How to parse XML in JavaScript from Google I want to parse this XML Document http://www.google.de/ig/api?weather=Braunschweig,%20Deutschland I want to be able to read out condition, temp_c and humidity. All this I want to do inside of JavaScript without using any server sided scripts such as PHP and I want it to wor... | {
"language": "en",
"url": "https://stackoverflow.com/questions/323982",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: Project methodology for small teams We're usually 1-4 developers / art directors / copywriters on each project at my firm, what methodology would you recommend use to use? Agile? XP? Scrum? Something else? (I know they are all variations of essentially the same concept, yes)
A: For pair programming, at least, it's ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/323984",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "19"
} |
Q: DDD repositories as singletons? Quick question: Would it be a good or a bad idea to implement my domain-driven design style repositories as singletons? Why?
Or should I maybe use a dependency injector container to manage my repositories and decide if they are singletons or not?
I'm still reading DDD Quickly, and wou... | {
"language": "en",
"url": "https://stackoverflow.com/questions/323987",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "5"
} |
Q: Primitive recursion how will i define the function 'simplify' using primitive recursion?
simplify :: Expr -> Expr
...
simplify
Simplify an expression using basic arithmetic, e.g.
simplify (Plus (Var "x") (Const 0)) = Var "x"
| {
"language": "en",
"url": "https://stackoverflow.com/questions/324003",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: memcpy vs assignment in C Under what circumstances should I expect memcpys to outperform assignments on modern INTEL/AMD hardware? I am using GCC 4.2.x on a 32 bit Intel platform (but am interested in 64 bit as well).
A: You should never expect them outperform assignments. The reason is, the compiler will use memc... | {
"language": "en",
"url": "https://stackoverflow.com/questions/324011",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "32"
} |
Q: Putting a value on the load of a windows system I've written an image processing script in php which is run as a cron scheduled task (in OSX). To avoid overloading the system, the script checks the system load (using 'uptime') and only runs when load is below a predefined threshold.
I've now ported this over to Wind... | {
"language": "en",
"url": "https://stackoverflow.com/questions/324014",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: Supplying 64 bit specific versions of your software Would I expect to see any performance gain by building my native C++ Client and Server into 64 bit code?
What sort of applications benefit from having a 64 bit specific build?
I'd imagine anything that makes extensive use of long would benefit, or any application ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/324015",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "8"
} |
Q: How do I get keyboard events in an NSStatusWindowLevel window while my application is not frontmost? After creating a translucent window (based on example code by Matt Gemmell) I want to get keyboard events in this window. It seems that there are only keyboard events when my application is the active application wh... | {
"language": "en",
"url": "https://stackoverflow.com/questions/324032",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "5"
} |
Q: How do I BringToView the latest item added to a bound ObservableCollection I have a silverlight control (View) which displays a list of items in a specified property of the datacontext (viewmodel).
What I need is for the scrollviewer in my control to scroll to the top or bottom depending on where the latest item has... | {
"language": "en",
"url": "https://stackoverflow.com/questions/324035",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "2"
} |
Q: Where can I get databases of cities/places around the world? In dopplr [http://www.dopplr.com] there is an option to fill the city of travel and the site will automatically find the city around the world. Is there any web service or database for such a city lookup?
A: http://www.geonames.org/ is useful - HTML query... | {
"language": "en",
"url": "https://stackoverflow.com/questions/324039",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "10"
} |
Q: How does Windows determine/handle the DOS short name of any given file? I have a folder with these files:
alongfilename1.txt <--- created first
alongfilename3.txt <--- created second
When I run DIR /x in command prompt, I see these short names assigned:
ALONGF~1.TXT alongfilename1.txt
ALONGF~2.TXT alongfilename3.tx... | {
"language": "en",
"url": "https://stackoverflow.com/questions/324041",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "12"
} |
Q: How best to switch from template mess to clean classes architecture (C++)? Assuming a largish template library with around 100 files containing around 100 templates with overall more than 200,000 lines of code. Some of the templates use multiple inheritance to make the usage of the library itself rather simple (i.e.... | {
"language": "en",
"url": "https://stackoverflow.com/questions/324043",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: Connecting to Oracle from ASP.NET is very slow - how to diagnose? I have an ASP.NET application that's connecting to an oracle database.
Performance on some queries in dev is very slow - on the order of 90 seconds to connect to the database, run a a query (actually, call a SP in a package) and return a single row of... | {
"language": "en",
"url": "https://stackoverflow.com/questions/324044",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: Windows temporary files behaviour - are they deleted by the system? Using the .net framework you have the option to create temporary files with
Path.GetTempFileName();
The MSDN doesn't tell us what happens to temporary files. I remember reading somewhere that they are deleted by the OS when it gets a restart. Is t... | {
"language": "en",
"url": "https://stackoverflow.com/questions/324045",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "44"
} |
Q: Managing page sequence In an ASP.NET 3.5 site we have a relatively standard payment checkout progess that contains a number of pages that need to be visited in sequence (shopping basket, payment details etc)
Each page has a "Continue" button that redirects to the next page in the sequence.
I would like a way of mana... | {
"language": "en",
"url": "https://stackoverflow.com/questions/324047",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "2"
} |
Q: Find out the size of a .NET object I'm trying to find out how much memory my objects take to see how many of them are ending up on the Large Object Heap (which is anything over 85,000 bytes).
Is it as simple as adding 4 for an int, 8 for a long, 4 (or 8 if you're on 64 bit) for any reference types etc for each objec... | {
"language": "en",
"url": "https://stackoverflow.com/questions/324053",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "58"
} |
Q: How to use Autofac in a 3 layered web application (ASP.NET MVC)? The examples I can find use a two layer architecture, where the controllers directly use the repository classes in the data access layer. See here or here.
Where would you register components from the data access layer if you have a service or business... | {
"language": "en",
"url": "https://stackoverflow.com/questions/324054",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "9"
} |
Q: I cannot change the target .NET Framework in IIS 6 The option to target another version of the .Net Framework is disabled on a particular test system we are using on a current project.
I have tried the following without success:
*
*Killing all W3WP.EXE processes
*Restarting the IIS service
*Remote Debugging has be... | {
"language": "en",
"url": "https://stackoverflow.com/questions/324061",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: C# syntax highlighter for blogging on BlogSpot I'm looking for a syntax highlighter cum code formatter for my blog on BlogSpot. I've tried several today, but the all want to include <style> tags, or reference a stylesheet. I'm looking for one that is ideal for segments of code, and includes styling inline. Any sug... | {
"language": "en",
"url": "https://stackoverflow.com/questions/324062",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "7"
} |
Q: How can I force the base constructor to be called in C#? I have a BasePage class which all other pages derive from:
public class BasePage
This BasePage has a constructor which contains code which must always run:
public BasePage()
{
// Important code here
}
I want to force derived classes to call the base cons... | {
"language": "en",
"url": "https://stackoverflow.com/questions/324066",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "16"
} |
Q: how to block a superclass method to be called to a subclass I'm extending the functionality of a class with a subclass, and I'm doing some dirty stuff that make superclass methods dangerous (app will hang in a loop) in the context of the subclass. I know it's not a genius idea, but I'm going for the low-hanging frui... | {
"language": "en",
"url": "https://stackoverflow.com/questions/324080",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "5"
} |
Q: Setting a publish page content programmatically I want to know how to set a Publishing page content through the code (MOSS 2007).
This is how I've created the page:
PublishingPage page = publishingWeb.GetPublishingPages().Add("MyPage.aspx", pageLayout);
SPFile pageFile = page.ListItem.File;
page.Title = "My Page"; ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/324085",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "4"
} |
Q: Why does System.Web.Hosting.ApplicationHost.CreateApplicationHost throw System.IO.FileNotFoundException? I saw something about needing to have the assembly available for the type of the first argument passed to the function. I think it is, I can't figure out what am I missing.
This code is in a service. I was runnin... | {
"language": "en",
"url": "https://stackoverflow.com/questions/324091",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "5"
} |
Q: How to access foreign key related column values using LinqToSql? I'm trying to wire-up LinqToSql to be my data access layer and running into a few issues, probably due to my lack of experience with LinqToSql.
I have two tables, one called Project and one called Employee. The Project has fields for OpenedBy and Clos... | {
"language": "en",
"url": "https://stackoverflow.com/questions/324095",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: I need to identify each iPhone user in my database application uniquely. What code would achieve this? I know each iPhone has a electronic identifier other than the phone # or ESN - how do I call it and what does it return?
A: The UIDevice class contains the information you need.
[[UIDevice currentDevice] uniqueIde... | {
"language": "en",
"url": "https://stackoverflow.com/questions/324099",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "5"
} |
Q: Non-fullscreen FLVPlayback I'm building a full-screen demo where I need to simulate a YouTube video. I dragged a video that plays an external .flv file.
It works fine if the stage isn't set to full-screen. But I need to set the stage to full-screen like this:
stage.displayState = StageDisplayState.FULL_SCREEN;
stage... | {
"language": "en",
"url": "https://stackoverflow.com/questions/324102",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: Strategy for dealing with large db tables I'm looking at building a Rails application which will have some pretty
large tables with upwards of 500 million rows. To keep things snappy
I'm currently looking into how a large table can be split to more
manageable chunks. I see that as of MySQL 5.1 there is a partitio... | {
"language": "en",
"url": "https://stackoverflow.com/questions/324103",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "10"
} |
Q: Grooviest way to store a BLOB in a database? While writing a utility script to insert images into a database I wondered if there were a groovier way of doing it. In the end settled for something along the lines of this:
def sql = Sql.newInstance(...)
// ...
Connection conn = sql.getConnection()
PreparedStatement... | {
"language": "en",
"url": "https://stackoverflow.com/questions/324104",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: Hibernate: Parse/Translate HQL FROM part to get pairs class alias, class name Can anyone point me out, how can I parse/evaluate HQL and get map where key is table alias and value - full qualified class name.
E.g. for HQL
SELECT a.id from Foo a INNER JOIN a.test b
I wish to have pairs:
a, package1.Foo
b. package2.T... | {
"language": "en",
"url": "https://stackoverflow.com/questions/324105",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "3"
} |
Q: Adopting Open Source Software in an organization What are the pros and cons of adopting Open Source software for an organisation? Is there anybody out there who has done this and how well has it been working out with some examples of the softwares they adopted and how it has been in use?
Usually contributions come b... | {
"language": "en",
"url": "https://stackoverflow.com/questions/324108",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "5"
} |
Q: PHP/SQL Server Report Writing What is a good method of writing reports using PHP and SQL Server? Is there a third party vendor that supports SQL Server?
A: SQL Server comes with Reporting Services out of the box as of version 2005. If you are using SQL Server 2000, Reporting Services 2000 is available as a free do... | {
"language": "en",
"url": "https://stackoverflow.com/questions/324116",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: What is the best way to implement active record in java? I wonder if with a simple Map<String,Object> implementation for plain records is enough.
I want to do it similar to Ror. When you add a field to the table in the database automatically you have access to the field in the Dto.
I don't want to add a field and th... | {
"language": "en",
"url": "https://stackoverflow.com/questions/324118",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "2"
} |
Q: split twice in the same expression? Imagine I have the following:
inFile = "/adda/adas/sdas/hello.txt"
# that instruction give me hello.txt
Name = inFile.name.split("/") [-1]
# that one give me the name I want - just hello
Name1 = Name.split(".") [0]
Is there any chance to simplify that doing the same job in just... | {
"language": "en",
"url": "https://stackoverflow.com/questions/324132",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "6"
} |
Q: Can autotools create multi-platform makefiles I have a plugin project I've been developing for a few years where the plugin works with numerous combinations of [primary application version, 3rd party library version, 32-bit vs. 64-bit]. Is there a (clean) way to use autotools to create a single makefile that builds... | {
"language": "en",
"url": "https://stackoverflow.com/questions/324134",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "2"
} |
Q: WPF VisualBrush with mixed aspect ratio We are using the Mindfusion WPF Diagramming Component. I require a Visualbrush which must be able to be used in a third-party component for diagramming.
We have horizontally-stretching lanes on the diagramming canvas. We must define a background color for this lane, and some ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/324146",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "4"
} |
Q: Conditional Attributes - Asp.Net MVC View I have a requirement to add conditional disabled & class attributes to a dropdown form element. I have the following however it does not write out either of the attributes in any state. Is there a way around this.
<%= Html.DropDownList("--Choose Make--", "models", ViewData[... | {
"language": "en",
"url": "https://stackoverflow.com/questions/324161",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: Should we use prefixes in our database table naming conventions? We are deciding the naming convention for tables, columns, procedures, etc. at our development team at work. The singular-plural table naming has already been decided, we are using singular. We are discussing whether to use a prefix for each table name... | {
"language": "en",
"url": "https://stackoverflow.com/questions/324163",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "12"
} |
Q: How do I independently change the width and height of a font in .NET? Given something like this:
thefont = New Font("Courier New", fontheight)
and this:
' g is a Graphics object
g.DrawString("some text", thefont, Brushes.Black, X, Y)
what can I put in the middle of the two to change the width of the font, so that "s... | {
"language": "en",
"url": "https://stackoverflow.com/questions/324166",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "2"
} |
Q: remove whitespace from bash variable Assuming a variable contains spaces, newlines, and tabs followed by some text, why does this:
${var#"${var%%[![:space:]]*}"} # strip var of everything
# but whitespace
# then remove what's left
... | {
"language": "en",
"url": "https://stackoverflow.com/questions/324167",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "8"
} |
Q: MSXML2::IXMLDOMDocument2Ptr->GetXML() messing up my string! All,
this is my code
//declare string pointer
BSTR markup;
//initialize markup to some well formed XML <-
//declare and initialize XML Document
MSXML2::IXMLDOMDocument2Ptr pXMLDoc;
HRESULT hr;
hr = pXMLDoc.CreateInstance(__uuidof(MSXML2::DOMDocument40));
... | {
"language": "en",
"url": "https://stackoverflow.com/questions/324168",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "2"
} |
Q: How to pass server-side error messages to ASP.NET Ajax client? An example scenario:
*
*User performs an update, for example a drag & drop. This is an ajax request.
*Server-side code cannot validate the update or the operation just fails. An exception is thrown.
*A reasonable error message should be shown to the... | {
"language": "en",
"url": "https://stackoverflow.com/questions/324170",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "2"
} |
Q: mount a windows smb share on OS X as so it can be accessed by 'www' user trying to mount an smb share on OS X so that the 'www' user can read files from there.
the SMB share is accessible via an Active Directory account. I can mount the share through the Finder (cmd-k ...)
my basic approach is
# 1) create mountpoint... | {
"language": "en",
"url": "https://stackoverflow.com/questions/324171",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "2"
} |
Q: Query vs. View I want to know what is the difference between a query and a view in terms of performance. And if a view is costly, what else besides a query could I do to improve performance?
A: I can't speak for all databases, but in SQL Server you cannot index views unless you have an Enterprise version. An uninde... | {
"language": "en",
"url": "https://stackoverflow.com/questions/324177",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "8"
} |
Q: Is it possible in SQL Server to create a function which could handle a sequence? We are looking at various options in porting our persistence layer from Oracle to another database and one that we are looking at is MS SQL. However we use Oracle sequences throughout the code and because of this it seems moving will be... | {
"language": "en",
"url": "https://stackoverflow.com/questions/324178",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: Is UML a good notation for messaging systems? Ever since the publication of Enterprise Integration Patterns people have been using the notation introduced in that book for documenting asynchronous heterogenous messaging systems.
But our shop is more or less standardized around a proprietary documentation tool that d... | {
"language": "en",
"url": "https://stackoverflow.com/questions/324180",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "2"
} |
Q: Number VS Varchar(2) Primary Keys I'm now to this point of my project that I need to design my database (Oracle).
Usually for the status and countries tables I don’t use a numeric primary key, for example
STATUS (max 6)
AC --> Active
DE --> Deleted
COUNTRIES (total 30)
UK --> United Kingdom
IT --> Italy
GR --> Gree... | {
"language": "en",
"url": "https://stackoverflow.com/questions/324181",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "11"
} |
Q: removing the "T" from a datetime when doing a xml+xsl=html with .net (XmlDataDocument,XslCompiledTransform,XmlTextWriter) what is the easiest way to remove the "T" from the result?
I want the result to be "YYYY/MM/DD HH/MM/SS"
the vb.net code is really straight forward
xmlDoc = New Xml.XmlDataDocument(data_s... | {
"language": "en",
"url": "https://stackoverflow.com/questions/324188",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: What advice can you give me for writing a meaningful benchmark? I have developed a framework that is used by several teams in our organisation. Those "modules", developed on top of this framework, can behave quite differently but they are all pretty resources consuming even though some are more than others. They all... | {
"language": "en",
"url": "https://stackoverflow.com/questions/324200",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "5"
} |
Q: What is the fastest way to parse large XML docs in Python? I am currently running the following code based on Chapter 12.5 of the Python Cookbook:
from xml.parsers import expat
class Element(object):
def __init__(self, name, attributes):
self.name = name
self.attributes = attributes
self... | {
"language": "en",
"url": "https://stackoverflow.com/questions/324214",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "72"
} |
Q: How does licensing model work for Microsoft Office PerformancePoint Server 2007? I am confused about the licensing model for Microsoft PerformancePoint Server.
When I look at
http://www.microsoft.com/business/performancepoint/howtobuy/default.aspx
I see a 20,000 USD Server License, plus a 200 USD CAL license. But t... | {
"language": "en",
"url": "https://stackoverflow.com/questions/324219",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: How to run my program on before logout on windows XP? I am looking for an inverse version of "RunOnceEx".
RunOnceEx does run some program, before the user's shell(desktop&taskbar) start. The login progress will not continue before the runonceex complete.
I want to do exact the same but on user logout.
When she/he lo... | {
"language": "en",
"url": "https://stackoverflow.com/questions/324220",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "9"
} |
Q: UpdatePanel doesn't Refresh I have got a simple page with a HtmlInputHidden field. I use Javascript to update that value and, when posting back the page, I want to read the value of that HtmlInputHidden field. The Value property of that HtmlInputHidden field is on postback the default value (the value it had when th... | {
"language": "en",
"url": "https://stackoverflow.com/questions/324222",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: How can I get a frame's content with mshtml? Here's the issue:
I have a hook in IE that reacts on WebBrowser.OnNavigateComplete2 event to parse the content of the document for some precise info.
That document contains frames, so I look into the HTMLDocument.frames. For each one, I look into the document.body.outerHT... | {
"language": "en",
"url": "https://stackoverflow.com/questions/324231",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "2"
} |
Q: How would I approach building a results predictor for a Football Management sim? I'm looking for some food-for-thought on how games like Football Manager and Championship Manager achieve a fairly high level of realism when it comes to simulating realistic scorelines. I am conscious that some of these algorithms woul... | {
"language": "en",
"url": "https://stackoverflow.com/questions/324234",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "3"
} |
Q: ASP.NET - show application build date/info at the bottom of the screen I have a asp.net web application which has a number of versions deployed on different customer servers inside their networks. One practice that we have is to have clients email screenshots when they have issues.
In the old asp.net 1.1 days, we c... | {
"language": "en",
"url": "https://stackoverflow.com/questions/324245",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "32"
} |
Q: Is there an equivalent to the .Net FileSystemWatcher in the Linux world? I find the .Net FileSystemWatcher class really handy for writing utilities that automatically come to life when files show up in their watched folders. Is there any equivalent to this functionality in the *nix world that would allow me to watch... | {
"language": "en",
"url": "https://stackoverflow.com/questions/324258",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "10"
} |
Q: How do i transform a number to a repetition of characters in XSLT? I have the following input:
<node TEXT="txt">
<node TEXT="txt">
<node TEXT="txt"/>
<node TEXT="txt"/>
</node>
<node TEXT="txt"/>
</node>
<node TEXT="txt"/>
I am currently using:
<xsl:number level="multiple" count="node" format="1"/>
w... | {
"language": "en",
"url": "https://stackoverflow.com/questions/324259",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "2"
} |
Q: Finding out why a process is spending time in the kernel in win32 I'm compiling a vc8 C++ project in a WinXp VmWare session. It's a hell of a lot slower than gcc3.2 in a RedHat VmWare session, so I'm looking at Task Manager. It's saying a very large percentage of my compile process is spent in the kernel. That do... | {
"language": "en",
"url": "https://stackoverflow.com/questions/324261",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "0"
} |
Q: batch file to delete files older than a specified date How do I create a batch file to delete files older than a specified date?
This does not seem to work;
:: --------DELOLD.BAT----------
@echo off
SET OLDERTHAN=%1
IF NOT DEFINED OLDERTHAN GOTO SYNTAX
for /f "tokens=2" %%i in ('date /t') do set thedate=%%i
type %1... | {
"language": "en",
"url": "https://stackoverflow.com/questions/324267",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "16"
} |
Q: Querying list items and using SharePoint web services vs the object model My company is looking into writing a custom application that will need to perform many list item queries across multiple site collections. It will need to run for WSS 3.0 and it 'would be nice' if it worked on WSS 2.0 as well. It won't be desi... | {
"language": "en",
"url": "https://stackoverflow.com/questions/324272",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "5"
} |
Q: Subversion... practical with a PHP framework app or not? I am developing a website using CodeIgniter and PHP. Some of my friends suggest I start using Subversion to take care of my organization. Could someone give me a basic explanation of what SVN is without the jargon and also if it is practical for a framework ... | {
"language": "en",
"url": "https://stackoverflow.com/questions/324277",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: throwing an exception in objective-c/cocoa What's the best way to throw an exception in objective-c/cocoa?
A: Use NSError to communicate failures rather than exceptions.
Quick points about NSError:
*
*NSError allows for C style error codes (integers) to clearly identify the root cause and hopefully allow the err... | {
"language": "en",
"url": "https://stackoverflow.com/questions/324284",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "425"
} |
Q: XQuery to get list of attributes If I have several Section elements in an XML document, what XQuery do I use to get a list of all the name values?
<Section name="New Clients" filePath="XNEWCUST.TXT" skipSection="False">
A: In XPath 2.0 (which is a subset of XQuery) one would use the following expression to get a s... | {
"language": "en",
"url": "https://stackoverflow.com/questions/324289",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "4"
} |
Q: "Cut and Paste" - moving nodes in the DOM with Javascript I have html code that looks roughly like this:
<div id="id1">
<div id="id2">
<p>some html</p>
<span>maybe some more</span>
</div>
<div id="id3">
<p>different text here</p>
<input type="text">
<span>maybe even a form item</span>
</d... | {
"language": "en",
"url": "https://stackoverflow.com/questions/324303",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "52"
} |
Q: How can I cut off a RSS feed description after 2 sentences using preg_split? I want to take a description of a RSS feed located in $the_content and cut it off after 2 full sentences (or 200 words and then the next full sentence) using preg_split.
I tried a couple times, but I'm way off. I know what I want to do, but... | {
"language": "en",
"url": "https://stackoverflow.com/questions/324306",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Q: Symbolic simplification in Haskell (using recursion?) How can I give a general rule that includes all the expressions below?
E.g one expression, another one for sub and one for mult.
I need to use recursion but i got confused...
simplify :: Expr->Expr
simplify (Mult (Const 0)(Var"x"))
= Const 0
simplify (Mult (Va... | {
"language": "en",
"url": "https://stackoverflow.com/questions/324311",
"timestamp": "2023-03-29T00:00:00",
"source": "stackexchange",
"question_score": "1"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.