input stringlengths 51 42.3k | output stringlengths 18 55k |
|---|---|
How do I upload an image/file using a post request in C#? <p>C# provides functionality to submit a post request, but there is nothing about uploading an image/file on MSDN. I'd like to do this without using raw headers.</p>
<h3>Related questions</h3>
<p><a href="http://stackoverflow.com/questions/566462/upload-files-... | <p>You can use <code>WebClient</code> class easily. It has an <code>UploadFile</code> method:</p>
<pre><code>var client = new WebClient();
client.UploadFile("http://server/upload.aspx", @"C:\file.jpg");
</code></pre>
|
ASP.NET web site on IIS7 on Vista <p>I have dev an MVC app and deployed it to my local IIS as I am using dev server to dev.</p>
<p>This is on Vista Ultimate.</p>
<p>When i browse the site all the images are not showing and also the
login page is displayed.</p>
<p>what would be causing the images not to show and also... | <p>This could be a deployment issue, rather than a permissions issue. Did you try to browse directly to an image via your browser?</p>
<p>So if you have an image located in your project as </p>
<pre><code>\images\login.png
</code></pre>
<p>open in your browser to: </p>
<pre><code>http://hostname/images/login.png
</... |
delete *.pyc continuation <p>As a follow-up to <a href="http://stackoverflow.com/questions/755694/delete-pyc">this question</a>, I have a new question:</p>
<p>What is happening internally in <code>os.remove(module_name)</code> and <code>del sys.modules["module_name"]</code>?</p>
| <p>The short answer is that <code>os.remove(module_name)</code> will remove a file from the filesystem. <code>del sys.modules["module_name"]</code> will remove a module from the cache of previously loaded modules that the current Python interpreter is maintaining.</p>
<p>In Python, when you import a module, the inter... |
Why does my CSS (apparantly) force a scrollbar to appear regardless of content size? <p>I apologize for the long paste of code here, but this has been bugging me for a good few hours now. I'm working on porting my entire site over into a new template, and I'm trying to make the various areas and things more size-aware ... | <p>Taking the height 100% off the body windows.css fixes the problem on Firefox, that may give you a place to start looking.</p>
|
Simple HttpWebRequest over SSL (https) gives 404 Not Found under C# <p>I want to make a POST to a php-written Web Service that sits on a secure connection. The following code is just a test console app I wrote after a few hours of trial and error. Essentially, I found out a few different methods to use HttpWebRequest, ... | <p>After some experimentation using fiddler and firefox, it seems that your URL is the problem. For me, this gives a 404:</p>
<p>https://servicios.mensario.com/enviomasivo/apip/</p>
<p>and this doesn't:</p>
<p>https://servicios.mensario.com/enviomasivo/apip</p>
<p>Note, the ending slash. Also, the php sample you p... |
multiple where clause in query failing <p>I am trying to select the following query from my table:</p>
<pre><code>SELECT ARTICLE_NO, USERNAME, ACCESSSTARTS, ARTICLE_NAME,
date_format(str_to_date(ACCESSSTARTS, '%d.%m.%Y %k:%i:%s'), '%d %m %Y' ) AS shortDate
FROM AUCTIONS WHERE SUBCAT = 'fake' and USERNAME = 'testuser... | <p>i think, that you have no result with a combination of "fake" AND "testuser"? (do you mean OR?)</p>
|
How do I archive log files in a database? <p>I need help on executing archived log files in the database, instead of inserting each of the logs in the execute statement below one by one is there a way i can
include all the logs at once in one single statement in a script?</p>
<pre><code>EXECUTE DBMS_LOGMNR.ADD_LOGFILE... | <p>Use SQL and sqlplus to generate the command to a spool file</p>
<pre><code>spool c:\temp\log.sql
select 'EXECUTE DBMS_LOGMNR.ADD_LOGFILE(LOGFILENAME =>'''||name||'''||,OPTIONS => DBMS_LOGMNR.NEW);'
from v$archived_log;
spool off
</code></pre>
<p>then execute the spool file in sqlplus</p>
<pre><cod... |
IE only prints properly through Print Preview? <p>Has anyone come across the problem where Internet Explorer won't print a page properly unless I go through print preview? If I just click print directly, or the print button on the page, it prints two pages, the first with just the heading on it, and the second one blan... | <p>I ran into this same problem. Adding the following meta data forcing it back down to IE7 standard rendering mode fixed it for me.</p>
<pre><code>< meta http-equiv=X-UA-Compatible" content="IE=7">
</code></pre>
|
Anybody cross compiled Mono for MIPS 64 using uClibc? <p>I am trying to statically cross compile Mono for MIPS. I am able to compile Mono, but it is always dynamically linked with it's dependencies, even though I specify static to the compiler.</p>
<p>I wrote a test program and I am able to statically compile it with... | <p>In order to get a fully statically linked Mono you will have to build all it's dependencies (and their dependencies recursively) as static libraries first. Only then you can build a truly static Mono.</p>
|
DataGridView repeatedly recreating columns <p>I have a problem when assigning the <code>DataSource</code> propery on a <code>DataGridView</code> control. My <code>DataSource</code> is a <code>DataTable</code>'s <code>DefaultView</code> and, as expected, columns are automatically created in the <code>DataGridView</code>... | <p>I have an app that uses a DataGridView to display the contents of a DataTable, but I link them like this:</p>
<pre><code>dataGridView.DataSource = dataTable;
</code></pre>
<p>Can you try this?</p>
<p>EDIT:</p>
<p>I also have the following in the auto generated code:</p>
<pre><code>this.dataGridView.EditMode = S... |
ajax problems? with activexobjects <p>I keep getting the following error's:</p>
<blockquote>
<p>uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIXMLHttpRequest.send]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: <a href="http://site/cms/js/inte... | <p>Due to security restrictions in Javascript, it is not possible to retrieve information from remote domains via an XMLHttpRequest.
I think you need a proxy!</p>
|
Distinguished field on a web service (BizTalk) <p>How do you access a field in the message returned by a web service call ?</p>
<p>I found Richard Seroters <a href="http://blogs.msdn.com/richardbpi/archive/2006/11/09/setting-promoted-distinguished-fields-on-biztalk-web-messages.aspx" rel="nofollow">blog post</a> but i... | <p>It would seem that ...</p>
<p><em>If the method includes something other than primitive data types, there will also be a Reference.xsd file under Reference.map. After adding this reference, weâll be able to create messages to communicate with the web service defining the type as a Web Message and choosing the ap... |
Is there any pywin32 odbc connector documentation available? <p>What is a good pywin32 odbc connector documentation and tutorial on the web?</p>
| <p>Alternatives:</p>
<ul>
<li>mxODBC by <a href="http://egenix.com" rel="nofollow">egenix.com</a> (if you need ODBC)</li>
<li><a href="http://code.google.com/p/pyodbc" rel="nofollow">pyODBC</a></li>
<li><a href="http://www.sqlalchemy.org/" rel="nofollow">sqlalchemy</a> and DB-API 2.0 modules (which isn't ODBC) but it'... |
Replace text in Word Document with ActiveX? <p>I want replace some string within Word Document using ActiveX and JavaScript, now I have something like this:</p>
<pre><code>var text = Selection.Text;
Selection.Text = text.replace('somesting','somevalue');
</code></pre>
<p>But after that I loose all formaing.
If I reco... | <pre><code>Selection.Find.Execute('somestring',
false,
false,
false,
false,
false,
wdFindContinue,
false,
false,
... |
Search Engine Optimization reading material and references request <p>Search Engine Optimization (SEO) seems to be a topic I'm running into more and more and I would like to know a little more about it.</p>
<p>However, it seems to be very difficult to find any solid information about it. The <a href="http://en.wikiped... | <p>Start by reading Google's <a href="http://www.google.com/webmasters/docs/search-engine-optimization-starter-guide.pdf" rel="nofollow">SEO starter guide</a>.</p>
|
Difference between sp_spaceused and DataLength SQL Server <p>I have a table with single Row when i use SP_SpaceUsed N'<TableName>' it gives me data as 16 KB</p>
<p>and when I use dataLength something like this:-</p>
<pre>
select ClientID ,
(0 + isnull(datalength(ClientID), 1) +
isnull(datalength(LeadID), 1) +... | <p>sp_spaceused counts the space used by pages, which are 8k blocks.
Remember that a table also includes things like indexes that take up space too. not to mention that data on pages are never full unless the fill factor is 100%</p>
<p>datalength will tell you how many bytes your column is</p>
|
ASP.NET Base64 string corruption <p>I am passing an object from one asp.net page to another. I'm encoding the object as a Base64 string and passing it as a POST parameter. However, when the receiving page reads the POST value, if there is a + sign in the Base64 string, it is being replaced with a line break. For exa... | <p>Use <a href="http://msdn.microsoft.com/en-us/library/zttxte6w.aspx" rel="nofollow">UrlEncode</a>. The + is a reserved character and needs to be encoded.</p>
|
Winforms listbox not updating when bound data changes <p>The image below shows how my code works. When I press button2 the listbox is updated, but not when I press button1. Why?</p>
<p><img src="http://i44.tinypic.com/mj69oj.gif" alt="pseudo code" /></p>
<p>Is the problem threading related? If it is, where should I a... | <p>My guess is that this is due to the update message being handled on the wrong thread. Background: each thread has its own message queue. Messages posted into the message queue will land in the same thread as the caller by default. Therefore, the callback will maybe post a message on the wrong thread.</p>
<p>Try thi... |
Support for Long Running Operations using the MOSS Publishing Infrastructure <p>I have used the Long Running Operation capability within the Publishing Infrastructure within MOSS (SharePoint) in the past, and am curious if anyone knows if this is a supported technique for having custom long running operations within Sh... | <p>SharePoint Timer Jobs are described in MSDN Journal April edition
<a href="http://msdn.microsoft.com/en-us/magazine/dd569748.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/magazine/dd569748.aspx</a></p>
|
Java to access pci-modem <p>I have a pci-modem in my laptop and I tried to run a program that opens the port and configures it.I get an excepcion while doing it, I think that it can't see the port, even though it is on COM3. Is there any way of doing it in java?</p>
<p>The error I get is noClassDefFoundError. It says... | <p>A NoClassDefFoundError indicates that you're missing a JAR file from your classpath, specifically the one that is holding SerialPortEventListener class. Check your classpath.</p>
|
Problems with displaying edited pictures in a GUI created in Matlab <p>I have an assignment to create a GUI using the matlab built-in gui guide and am having a problem with displaying an edited picture. I need to have buttons that edit the picture (eg. remove red, blue, green components and rotate) and display that ed... | <p>When you first plot the image with <a href="http://www.mathworks.com/access/helpdesk/help/toolbox/images/imshow.html" rel="nofollow">IMSHOW</a>, have it return a handle to the image object it creates:</p>
<pre><code>A = (the initial matrix of image data);
hImage = imshow(A);
</code></pre>
<p>Then, to update the im... |
How to guarantee uniqueness of a referrer who clicks on a link in a remote webpage("Request.UserHostAddress" not working correctly)? <p>we can use <code>Request.UserHostAddress</code> to catch referrer IP address(for example who clicked a link) but you know by this way we can't ensure about uniqueness of user! this ip ... | <p>The answer from Grzenio is correct; I'll just elaborate a bit. The only way to make sure that the client sends you something unique is for you to have sent it to the client first, and for you to have made sure it is unique. Creating a GUID and setting it in a cookie is one way to do it. If you care about spoofing, t... |
If I fill a GridView with anonymous objects, how can i get their properties? <p><br />
I have a GridView what I fill through a LINQ expression.<br />
Something like this:</p>
<pre><code>GridView1.DataSource = from c in customers, o in c.Orders,
total = o.Total where total >= 2000 select new {id = c.CustomerID,
... | <p>Name your type!</p>
<pre><code>public class GridType
{
public int Id {get; set:} . . etc
}
</code></pre>
<p>then in linq, </p>
<pre><code>. . . select new GridType {...etc}
</code></pre>
<p>Then in the RowCreated method, cast the dataitem to GridType, and you can ccess it's properties.</p>
<p>Otherwise your... |
Appengine - How to change an entity of kind Model to Polymodel without losing existing entities <p>I am using appengine and appenginepatch for django</p>
<p>I have a class defined in my models that was inheriting from db.Model. I've now changed it to polymodel.PolyModel. Since making the change, my existing entities a... | <p>Solved using gaebar, google app engine backup and restore. Although this isnt necessarily going to be the best solution for large datastores..</p>
|
Pocket IE throws ODBC error but desktop browsers do not <p>I have a fairly simple CRUD web application (C#/ASP.NET) that runs fine in Firefox, IE7, and Chrome. (I'm accessing and testing the application on our development server.)</p>
<p>When I connect to the dev site via a Pocket PC device and go through the exact sa... | <ul>
<li><p>Check the values are submitted as you
expect them in the request handler</p></li>
<li><p>Check the values are passed to the
database statements correctly</p></li>
<li><p>Implement server-side error logging /
tracing</p></li>
<li><p>Memorize the text of the error
message(s)</p></li>
</ul>
|
Remapping Mouse Controls with Zedgraph? <p>I am using ZedGraph and I want to zoom to a selected area by holding down <code>Ctrl</code> and dragging the box with the left mouse button instead of clicking and dragging with the middle mouse button. </p>
<p>The default behavior is to zoom with just the left mouse button a... | <p>The ZedGraphControl allows Pan & Zoom to be controlled through properties of the control. To enable panning with just the left mouse button:</p>
<pre><code>zg1.PanButtons = MouseButtons.Left;
zg1.PanModifierKeys = Keys.None;
</code></pre>
<p>and to enable Zoom with Ctrl+Left mouse button:</p>
<pre><code>zg1.Z... |
Recreate a Flex 3 scene <p>Does anyone know how i can reset/reinitialize a state in flex 3?</p>
<p>Let's say I have the following code:</p>
<pre><code><mx:states>
<mx:State name="Scene1">
<mx:AddChild>
<Scenes:Scene1 id="scene1"></Scenes:Scene1>
</mx:Ad... | <p>I am not certain this is what you are looking for, but this code will render the states you have defined above:</p>
<pre><code>// this shows Scene1
this.currentState = "Scene1";
// this shows Scene2
this.currentState = "Scene2";
</code></pre>
<p>Is that what you were looking for?</p>
|
ORA-01654: unable to extend index <p>Calling all Oracle Gurus!</p>
<p>I am in the process of clustering a well tested application on WebSphere. The application in question made it about half way through processing 1k of JMS messages from a queue before this happened.</p>
<pre><code>---- Begin backtrace for Nested Thr... | <p>You are out of disk space.</p>
<p>Increase your <code>TABLESPACE</code>:</p>
<pre><code>ALTER TABLESPACE DABUAT_TBLSP
ADD DATAFILE 'C:\FolderWithPlentyOfSpace\DABUAT_TBLSP001.DBF'
SIZE 4M
AUTOEXTEND ON NEXT 4M
MAXSIZE 64G;
-- Put your own size parameters here
</code></pre>
|
how to create insert query on the fly, in entity framework using create query method? <p>I am using something like the above sample code but when i try to execute it, it says that
the query syntax is wrong and there is an error in the query syntax near keyword into...</p>
<pre><code>System.Data.Objects.ObjectParamete... | <p>Now after more than four months or so I can answer this... </p>
<pre><code>string tableName = "yourTableName";
string PrimaryColName = "PrimarykeyName";
using(Entities entities = new Entities)
{
string sQuery= " select value " + tableName + " from " + tableName + " as " + tableName;
sQuery += " where ";
... |
How to move a MySQL database to an external hard disk? <p>I am running OS X 10.5 and I do not know much about MySQL configuration. I am using a local MySQL database to deposit data from an application but it is getting close to my hard disk's capacity. What do I need to do to get the database stored on my external ha... | <p>One way would be to use mysqldump to create a new database on your external disk.</p>
<p>The point your application at that instance of the database.</p>
|
Need help with asynchronous operation <p>I'm relatively new to asynchronous and service-oriented programming and want to do the following:</p>
<ol>
<li>Fire off a stored procedure in a database that could run for minutes or even hours. </li>
<li>Return a code to the caller of a job id that the client can use to track ... | <p>When running asynchronous calls is good custom to setup some kind of callback to handle the result of the procedure (I am not talking strictly about stored procedures, could be any asynchronously invoked call) - which could be a result set or simply a success/failure indicator.</p>
<p>If you make considerate use of... |
PHP/MySQLi: SET lc_time_names and DATE_FORMAT() into a mysqli query? <p>I use the next code to retrieve data from a table in the database:</p>
<pre><code>$check_sql = 'SELECT personID, name, DATE_FORMAT(persons.birthdate, "%d de %M, %Y"), birthplace, countryID FROM persons WHERE personID = ?';
if ($stmt->prepare($... | <pre><code>$mysqli = new mysqli("localhost", "my_user", "my_password", "world");
$mysqli->query("SET lc_time_names = 'es_ES'");
$check_sql = 'SELECT personID, name, DATE_FORMAT(persons.birthdate, "%d de %M, %Y"), birthplace, countryID FROM persons WHERE personID = ?';
if ($stmt = $mysqli->prepare($check_s... |
Why do custom membership provider files have to be in the app_code folder of my web app? <p>I'm writing a custom memberhsip provider based on the source for the SQL provider and I tried first making the SQL Provider a separate project. Yet, the web app wouldn't recognize it unless I put all the source in an APP_Code fo... | <p>Make sure you specify the type as "Namespace.Type, Assembly.Name" if you have your provider in a compiled assembly. Like "System.String, mscorlib" or "System.Web.UI.Design.ControlDesigner, System.Design".</p>
<p>Example:</p>
<pre><code><membership defaultProvider="OlaMembershipProvider">
<providers>... |
Deep linking in JavaFX <p>Silverlight supports deep linking in the latest version. Does JavaFX?</p>
| <p>Answering with a non-answer because there hasn't been any yet...</p>
<p>I have not seen any references to deep linking in JavaFX.</p>
<p>Because I couldn't find any references to deep linking in JavaFX, I was curious as to whether or not JavaFX web apps even had access to URL parameters when loaded in a web page. ... |
SqlBulkCopy does not copy strings > 255 characters long <p>I am trying to copy a large Excel spreadsheet into the SQL Server database. I am opening an OldDbConnection to the Excel spreadsheet and reading everything from the [Sheet1$]. Then, I am using the OleDbCommand to get a IDataReader with the spreadsheet data. </p... | <p>in my experience with ADO data connections it may work better to retrieve and send large text strings when changing the cursor location of the recordset to client side.</p>
<p>here a short example:</p>
<pre><code>Dim rstADO As ADODB.Recordset
Set rstADO = New ADODB.Recordset
rstADO.CursorLocation = adUseClient
</c... |
gdb won't accept stdin redirection in Emacs <p>I'm trying to debug a program using gdb mode in emacs. It was compiled with g++, and I'm using cygwin. My program takes one command line argument, and also takes input from stdin, which I redirect from a file, like this:</p>
<pre><code>program.exe inputFile.dat <otherI... | <p>It seems that you have to use the <code>run</code> command:</p>
<blockquote>
<p>You can redirect your program's input and/or output using shell redirection with the run > command. For example,</p>
<pre><code>run > outfile
</code></pre>
</blockquote>
<p><a href="http://sourceware.org/gdb/current/onlinedocs/gd... |
ExternalInterface.addCallback not working? <p>I have a Flash/AS3 project I am trying to add a call back on, I added the call back like so:</p>
<pre><code>ExternalInterface.addCallback('force_refresh',force_refresh);
</code></pre>
<p>and I am calling in from JS like this:</p>
<pre><code>function thisMovie(movieName) ... | <p>So my call back method was expecting a parameter and I was not passing one when calling it from JS, so I guess it was just failing silently.</p>
|
Html table (text) to image using C# <p>Can anyone point me to some sample code in C# for converting an html table to image? I know how to convert text to image but i need to create an image of well formatted text. The whole text is formatted in html table.</p>
| <p>You can use the WebBrowser.DrawToBitmap method. Here is an <a href="http://pietschsoft.com/post/2008/07/C-Generate-WebPage-Thumbmail-Screenshot-Image.aspx">example</a>. So what I would do is create a page dynamically with the table you want, and nothing but the table, then use the DrawToBitmap method to save it to... |
Postgres XML datatype <p>What are the benefits of using the "xml" datatype versus storing the xml content inside a "text" datatype?</p>
<p>Am I able to query by some specific xml attribute or element?</p>
<p>What about indexing and query performance?</p>
<p>Besides the postgresql manual what other online sources can... | <p>Right now the biggest thing you get from XML fields over raw text is XPath. So if you had something similar to</p>
<pre><code>CREATE TABLE pages (id int, html xml);
</code></pre>
<p>you could get the title of page 4 by</p>
<pre><code>SELECT xpath('/html/head/title/text()', html) FROM pages WHERE id = 4;
</code></... |
Clicking on several links part dynamically generated <p>I'm new in Selenium and testing matters.
I'm trying to capture the id of an hyperlink element that is dynamically part generated.
The click action is recorded like as below when i make click on in selenium, the part in bold are dynamically generated, there are ma... | <p>Are you using the Selenium IDE? It would probably be much easier to do something using the other development environments, however if you really want to do looping:
<a href="http://51elliot.blogspot.com/2008/02/selenium-ide-goto.html" rel="nofollow">Get the looping user-extension from this page</a>
and run a script... |
How you would you describe the Observer pattern in beginner language? <p>Currently, my level of understanding is below all the coding examples on the web about the Observer Pattern. I understand it simply as being almost a subscription that updates all other events when a change is made that the delegate registers. How... | <p>The best example I can come up with is that of a mailing list (as an example).</p>
<p>You, the observer, subscribe to a mailing list and you observe the list. When you are no longer interested in the list, you unsubscribe. </p>
<p>This concept is the observer pattern. Two or more classes are involved. One or more ... |
Is there a parameter I can use in Java that works with all for-each loops? <p>Suppose I've got a method that accepts an array and processes each element in it using Java's built in <a href="http://java.sun.com/j2se/1.5.0/docs/guide/language/foreach.html">for-each loop</a>, like this:</p>
<pre><code>public static void ... | <p>I would suggest using <code>Iterable</code>, <code>Collection</code> or <code>List</code> as the parameter type.</p>
<p>IMO, collections should be preferred to reference arrays. If you happen to have an array <code>Arrays.asList</code> does the conversion nicely. <code>Arrays.asList</code> allows gets and sets back... |
Is there a way to enforce an atomic operation with no context switch in c#? <p>I have several lines of a method that I would like to ensure that there is no context switch to another thread while executing these? Yes, re-architecting is an option but it would be far more expedient for now if I could do this.</p>
<p>I... | <p>No, you can't. You can use a lock to make sure that no other threads will enter sensitive pieces of code to do with your operation, but that's all.</p>
<p>As for the "why" - it's generally not needed, and would be slightly strange in a pre-emptive operating system on a relatively high-level platform. It may be poss... |
Why is my "cat" function with system calls slower compared to Linux's "cat"? <p>I've done this function in C using system calls (open, read and write) to simulate the "cat" function in Linux systems and it's slower than the real one...</p>
<p>I'm using the same buffer size as the real "cat" and using "strace" I think ... | <p>Ah, based on your edit you were being bitten by the readahead buffer. You cannot test two programs that read files side by side by running them once. The first always be slower since the file is on disk, once the file is in memory the second will run faster, you must either create new data for each or run one and ... |
Thinking about scrapping my idea of writing a custom membership and roles provider. Opinions? <p>I've got a web app I'm building in ASP.NET that has the following security requirements:</p>
<ol>
<li>Must be able to integrate with a master authentication scheme that passes back a unique key to the application to indica... | <p>What you might want to do is to build your item 1 over the top of the existing functionality, try that first. With the information returned, automatically log the user in. If the first process fails, do the standard authentication using the built in code.</p>
<p>I have built this type of system on top of the ASP.... |
CodeIgniter Project Starter <p>I am wondering if there are any tools that you guys use to kick-start a CodeIgniter project similar to ROR? Thanks in advance!</p>
| <p>I've only tried CodeCrafter (<a href="https://launchpad.net/codecrafter" rel="nofollow">https://launchpad.net/codecrafter</a>) and it's quite decent, but there are others:</p>
<pre><code>http://*.com/trac/catalystmodel (see comment)
http://codeigniter.com/wiki/Rapyd_Components/
http://*.com/trac/quickmodel (see com... |
Adding an ArrayList into a class - what does it do? <p>Following on from this Q of mine: <a href="http://stackoverflow.com/questions/754184/whats-the-best-way-to-make-this-java-program">http://stackoverflow.com/questions/754184/whats-the-best-way-to-make-this-java-program</a></p>
<p>I was recommended to store a list i... | <p>With the first method, you need to expose methods that allow client code to add stuff to those lists. So, you could have:</p>
<pre><code>public class Lecturer
{
List<Course> courses = new ArrayList<Course>(); // a list to hold the courses
public Lecturer(String idIn, String nameIn)
{
... |
Easiest way to copy a dataview to a datatable in C#? <p>I need to copy a dataview into a datatable. It seems like the only way to do so is to iterate through the dataview item by item and copy over to a datatable. There has to be a better way. </p>
| <pre><code>dt = DataView.ToTable()
</code></pre>
<p>OR</p>
<p><code>dt = DataView.Table.Copy()</code>,</p>
<p>OR</p>
<p><code>dt = DataView.Table.Clone()</code>;</p>
|
WCF Web Service, cross-domain example <p>Can anyone point me to a good/simple example of creating a WCF web-service sitting on one website, followed with a simple example consuming that WCF web-service on another website?</p>
| <p><a href="http://msdn.microsoft.com/en-us/library/ms751514.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/ms751514.aspx</a> has some good examples for using WCF. </p>
<p>Consuming WCF from another site should be failrly straight forward, just don't forget to use a clientaccesspolicy.xml file.</p>
|
Manage XML documents in subversion ignoring formatting <p>I need to manage XML documents in Subversion but don't want to manage the formatting which may turn out differently depending on who is editing the file.</p>
<p>I see two solutions:
Either format the file each time with a known formatting before checking in.
Or... | <p>I don't have a lot of personal experience with such a setup. </p>
<p>For the second method (a custom diff), what I've found is an example, <a href="http://www.liberouter.org/documents/repository.pdf" rel="nofollow">"API description for Netopeer repository library"</a> which is a detailed description of a setup with... |
WPF code-behind for resources? <p>I'm working on a wpf application, and up until recently, I had a ResourceDictionary inside my main window's resources part of the xaml. The resource dictionary contained an DataTemplate that was used to style several listboxes in the window. The xaml for this datatemplate contained p... | <p>You can add a code-behind to a ResourceDictionary; just make sure your class names are referenced correctly. For instance, in the ResourceDictionary if you were working with AppStyles.xaml the XAML file would have a class of:</p>
<pre><code>x:Class="Client.App.Shell.themes.AppStyles"
</code></pre>
<p>In the code-b... |
How do I select a top level attribute of an xml column in SQL Server 2005? <p>I have an xml column in SQL Server 2005 that is the equivalent of:</p>
<pre><code><Test foo="bar">
<Otherstuff baz="belch" />
</Test>
</code></pre>
<p>I want to be able to get the value of the foo attribute of Test (the ... | <p>John Saunders has it almost right :-)</p>
<pre><code>declare @Data XML
set @Data = '<Test foo="bar"><Otherstuff baz="belch" /></Test>'
select @Data.value('(/Test/@foo)[1]','varchar(20)') as Foo
</code></pre>
<p>This works for me (SQL Server 2005 and 2008)</p>
<p>Marc</p>
|
Seam/Hibernate validator listener <p>We use a standard SEAM setup here ... complete with the validation system that uses hibernate.</p>
<p>Basically what happens is a user enters a value into an html input and seam validates the value they entered using the hibernate validation.</p>
<p>Works fine for the most part ex... | <p>You should be able to do it by creating a Bean that has a method observing the org.jboss.seam.validationFailed event. That method can then do whatever logging you want.</p>
<pre><code>@Name("validationObserver")
public class ValidationObserver() {
@Observer("org.jboss.seam.validationFailed")
public void va... |
PyQt - Transparent background <p>I try to make the background of my window transparent. But under widgets which are on it i see parts of my desktop-image.
Now i have this in constructor:</p>
<blockquote>
<pre><code> self.setFocusPolicy(Qt.StrongFocus)
self.setAttribute(Qt.WA_QuitOnClose,True)
self.setBackg... | <p>I've just found <a href="http://doc.trolltech.com/4.5/qwidget.html#transparency-and-double-buffering" rel="nofollow">this</a>:</p>
<blockquote>
<h2>Creating Translucent Windows</h2>
<p>Since Qt 4.5, it has been possible to
create windows with translucent
regions on window systems that support
compositi... |
Mapping Linq Entities and Domain Objects and object tracking <p>If I map my Domain objects to linq Entities will I now not be able to track changes when saving my domain objects? So for any change in my model that i wish to make, once I map the object to linq entities for submission to db, all object values will be sub... | <p>Depends on the O/R mapper you're using. You're referring to entity framework which doesn't do any change tracking inside the entity and therefore it needs help from you when you re-attach an entity which previously was fetched from the db (so it knows it's not new). </p>
|
Excel VBA print to specific printer tray <p>In Excel (2007) VBA how do I print the worksheet to a specific printer tray? This will just print to the default tray on the printer:</p>
<pre><code>ws.PrintOut ActivePrinter:="\\print_server\printer_name"
</code></pre>
| <p>Microsoft offers one <a href="http://support.microsoft.com/default.aspx?scid=kb;en-us;213815&Product=vba" rel="nofollow">ugly solution</a> to this problem; using <code>SendKeys</code> to manually choose the correct tray from the print settings dialog box.</p>
<p>Another option may be to set up additional printe... |
not having to encode url <p>Say I have this url "/my#stuff"</p>
<p>I am using asp.net mvc and when I try to goto this page it takes me to just "/my". The "#stuff" part has been removed.</p>
<p>Now I can get it to work fine if I encode the URL like so "/my%23stuff" since %23 decodes to #</p>
<p>However, is there a wa... | <p>I don't think there is a way to do what you are saying. The hash is used in a URL for anchor tags.</p>
<p>You are pointing at a page /my and navigating to anchor tag "stuff" on that page. If anchor tag "stuff" does not exist it will just navigate to page /my.</p>
|
Since SQL Server doesn't have packages, what do programmers do to get around it? <p>I have a SQL Server database that has a huge proliferation of stored procedures. Large numbers of stored procedures are not a problem in my Oracle databases because of the Oracle "package" feature.</p>
<p>What do programmers do to get ... | <p>While SQL Server has nothing to offer by way of the "cool features" of encapsulation and package state <strong>like you are used to</strong>, you can organize your stored procedures into schemas.</p>
<p>In enterprise manager, these procs are still all listed together which makes for a HUGE treelist if you have hund... |
How do I structure Python code into modules/packages? <p>Assume I have this barebones structure:</p>
<pre><code>project/
main.py
providers/
__init.py__
acme1.py
acme2.py
acme3.py
acme4.py
acme5.py
acme6.py
</code></pre>
<p>Assume that <code>main.py</code> contains (partial):</p>
<pre>... | <p>hey! two years later but... maybe could be helpfull to some one</p>
<p>make your <strong>providers/__init__.py</strong> like that:</p>
<pre><code>import os
import glob
module_path = os.path.dirname(__file__)
files = glob.glob(os.path.join(module_path, 'acme*.py'))
__all__ = [os.path.basename(f)[:-3] for f in file... |
Why would association.build not assign parent_id to it child? <p>I've got the following models:</p>
<p>In plan.rb</p>
<pre><code>has_many :tickets
</code></pre>
<p>and in ticket.rb</p>
<pre><code>belongs_to :plan
validates_presence_of :plan_id
</code></pre>
<p>When executing the following code in the controller </... | <p>I've had this happen when my object was new and unsaved when I called <code>build</code> on it. </p>
<p><code>build</code> assigns the <code>plan_id</code>, and if <code>@plan</code>'s id is nil, then your ticket's <code>plan_id</code> will be nil. Because <code>build</code> doesn't validate or save, you don't find... |
What's the accepted way to implement export functionality in a document-based Cocoa app? <p>I have a simple document-based Cocoa app that acts as a viewer for .wav files, to do a bit of frequency analysis. I'd like to be able to export the data gleaned from opened files to CSVs for further analysis in other programs.</... | <p>You can create a new action in MainMenu.nib's "First Responder" object, called "export:", and connect to it. Then, implement an export: method in your document subclass. This will call your method.</p>
<p>The reason this works is that messages sent to the magic first responder object go through the entire responder... |
Erlang on a JVM/CLR <p>I've just started reading Joe Armstrongs book on Erlang and listened to his excellent talk on Software Engineering Radio.</p>
<p>Its an interesting language/system and one whose time seems to have come around with the advent of multi-core machines.</p>
<p>My question is: what is there to stop i... | <p>You could not use JVM/CLR libraries, given their reliance on mutable objects. </p>
<p>Erlang exception handling is quite different from JVM and CLR exceptions, you would need to handle this somehow.</p>
<p>Implementing processes as threads would mean that any sizable Erlang system runs out of memory pretty fast (p... |
Which are the advantages of splitting the developer's time between two projects? <p>I have two projects, with identical priorities and work hours demand, and a single developer. Two possible approaches:</p>
<ol>
<li>Deliver one project first.</li>
<li>Split the developer's time and deliver both later.</li>
</ol>
<p>I... | <p>It seems to me that this decision often comes down to <strong><em>office politics</em></strong>. One business group doesn't want to feel any less important than another, especially with identical priorities set at the top. Regardless as to how many different ways you explain why doing both at the same time is a ba... |
Subsonic Deeploads: Is This Supported? <p>It could very well be that I'm just missing the correct vernacular in this space, but I'm looking for a particular piece of functionality in SubSonic. In NetTiers it was called a "DeepLoad". A deep load runs to the database and fetches many objects (ie. fetch this OrderDetail a... | <p>You can do this in SubSonic 3.0 (not yet released, but almost there...) using IQueryable with lazy loading:</p>
<pre><code>var db=new NorthwindDB();
var order=db.Orders.Where(x=>.xID==20).SingleOrDefault();
Assert.Equal(3,order.OrderDetails.Count());
</code></pre>
<p>if you're not on 3 (which requires .net 3.5)... |
Software needed to build a cluster <p>I've been thinking about getting a little bit greener with my computers and using some lower power, mini-itx boards in my next computer. Some can generate under 10 watts and are pretty inexpensive.</p>
<p>So I thought, if one is such low cost and low power, why not try to make a c... | <p>What do you want to actually do with your cluster kind of decides what software you will need.</p>
<ul>
<li>Do you need job scheduling? </li>
<li>Monitoring tools?</li>
<li>Do you need to deploy software across all nodes at once seamlessly? </li>
<li>One file system across all nodes (recommended). </li>
</ul>
<p>Y... |
Flex: Points to pixels and back again <p>So I have extended the PlotChart that comes with Flex to have the ability to draw trend-lines. To do this, I have to get pixel positions. How can I convert (100px,100px) in pixels to a point on the graph, such as (0.7,1.0)?</p>
| <p>You can draw on charts using the CartesianChartCanvas, here is the link to the LiveDoc: <a href="http://livedocs.adobe.com/flex/3/html/help.html?content=charts%5Feventsandeffects%5F13.html" rel="nofollow">Drawing on Chart Controls</a></p>
<p>To answer your question more specifically, CartesianChartCanvas supports d... |
Is this online tutorial a good starting point for creating a PHP5 framework for learning reasons? <p>I have found this tutorial online</p>
<p><a href="http://net.tutsplus.com/tutorials/php/creating-a-php5-framework-part-1/" rel="nofollow">http://net.tutsplus.com/tutorials/php/creating-a-php5-framework-part-1/</a></p>
... | <p>Alex, I must say I haven't read the article and please don't take this the wrong way, but I think the best way to learn about shortcomings of your own framework or to find out if it meets certain standards is to open it up - make it open source - and let other developers take part in it. They will be pretty quick to... |
Relative path to SQLite DB in context.xml <p>Is it possible to use a relative path to an SQLite database file in the context.xml file of a Java web application?</p>
<p>At present, I have:</p>
<pre><code><?xml version="1.0" encoding="UTF-8"?>
<Context path="/mywebapp">
<Resource name="jdbc/mydb" aut... | <p>I have found following examples of using JDBC with SQLite:</p>
<ul>
<li><p>For memory access:</p>
<pre><code> jdbc:sqlite::memory:
</code></pre></li>
<li><p>For relative paths:</p>
<pre><code> jdbc:sqlite:relative/path.db
</code></pre></li>
<li><p>For absolute paths:</p>
<pre><code> jdbc:sqlite:/absolute/path.db... |
How do you get jQuery intellisense working if you've implemented a Url Helper extension to get the URL of your script files? <p>I have implemented the Url Helper extensions that Kazi Manzur has suggested in his MVC best practices guide <a href="http://weblogs.asp.net/rashid/archive/2009/04/01/asp-net-mvc-best-practices... | <p>You don't have to include the "-vsdoc" part of the filename. The vsdoc intellisense file will be picked up automatically. However, that basic workaround is the only way I've been able to get intellisense to work with jquery and a method for the script path. I also have to put the workaround markup in any .ascx contr... |
I need a PHP script to decrypt the RSA encrypted string generated by <p>I need a PHP script to decrypt the RSA encrypted string generated by this JavaScript library - <a href="http://ohdave.com/rsa/" rel="nofollow">http://ohdave.com/rsa/</a></p>
<p>I'm either missing something or I don't know, but I don't remember wha... | <p>I dunno about you, but i do quick google and found this match:</p>
<p><a href="http://www.sematopia.com/?p=275" rel="nofollow">http://www.sematopia.com/?p=275</a><br>
<a href="http://www.phpclasses.org/browse/package/4121.html" rel="nofollow">http://www.phpclasses.org/browse/package/4121.html</a><br>
<a href="http:... |
Is it possible to get information about which advice has been caught in an adviceexecution pointcut? <p>I have an aspect in my application that intercepts every advice execution on the system. I want to be able to identify which advice is being "intercepted" by my adviceexecution pointcut like this </p>
<p>//... some ... | <p>You can get the Signature of the advice from the joinPoint. Signature has various methods to describe it. If it is just for debugging the toString() method describes it nicely</p>
<pre><code>before(): adviceexecution() && !within(AdviceInspector) {
org.aspectj.lang.Signature sig = thisJoinPoint.getStati... |
AS3 (or any language) trig library for triangles? <p>Does anyone know of a library for easily dropping in parameters of angles and lengths of sides, and letting it automagically extrapolate the non-given angles and lengths using trig? Even if it had lame performance, it would be very useful for prototyping, and perfor... | <p>It'll be tough to find a library because trig is so simple, you just need to do a quick formula.</p>
<pre><code> a^2 + b^2 = c^2
s=o/h c=a/h t=o/a
</code></pre>
<p>I'm thinking writing your own function to do these chores would be very very quick :)</p>
|
Is MD5 less secure than SHA et. al. in a practical sense? <p>I've seen <a href="http://stackoverflow.com/questions/157998/whats-the-difference-between-sha-and-md5-in-php">a</a> <a href="http://stackoverflow.com/questions/116684/what-algorithm-should-i-use-to-hash-passwords-into-my-database">few</a> <a href="http://stac... | <p>Yes, it is worth worrying about in practice. MD5 is so badly broken that <a href="http://www.win.tue.nl/hashclash/rogue-ca/">researchers</a> have been able to forge fake certificates that matched a real certificate signed by a certificate authority. This meant that they were able to create their own fake certificate... |
Debugging SQL Server 2005 Stored Procedures <p>I am using VS 2008 and trying to step into a stored procedure on a SQL Server 2005 database. I bring up Server Explorer, double-click on the procedure. It comes up in the text window. I set a break point in it, right click and select "Step into stored procedure". It comes ... | <p>I guess you have two different version of remote monitor running on each of these machines.</p>
<p>"<strong>This error commonly shows when mismatching versions of msvsmon.exe (Remote Debugging Monitor) is used.
They have to be of the same version in order to do remote CLR debugging. The locations:
2008 -> C:\Progr... |
How do I get around the Sum(First(...)) not allowed limitation is SSRS2005 <p>The problem that I have is SQL Server Reporting Services does not like Sum(First()) notation. It will only allow either Sum() or First().</p>
<p><strong>The Context</strong><br/>
I am creating a reconciliation report. ie. what sock we had a... | <p>I had a similar issue and ended up using ROW_NUMBER in my query to provide a integer for the row value and then using SUM(IIF(myRowNumber = 1, myValue, 0)). </p>
<p>I'll edit this when I get to work and provide more data, but thought this might be enough to get you started. I'm curious about Adolf's solution too. <... |
Changing the value of a const pointer <p>I have the following piece of code:</p>
<pre>
void TestFunc(const void * const Var1, const float Var2)
{
*(float*)Var1 = Var2;
}
</pre>
<p>It looks like I am changing the value of the const object the const pointer points to (thanks sharptooth), which should not be allowed. ... | <p>As others mentioned, the cast removes the 'constness' of the destination as far as the expression is concerned. When you use a cast the compiler treats the expression according to the cast - as long as the cast itself it valid (and C-style casts are pretty much the big hammer). This is why you don't get an error or ... |
How to Store Video in a Video Web Application <p>What is the best way to store lots of video in a web application? Hardware, Database, etc. If you were building a YouTube clone, how would you do it?</p>
| <p>I believe the way youtube handles it is storing the file location in a table in the DB, so when the request is made the file is located from the hard drive and then loads the file from there.</p>
<p>Take a look at: <a href="http://highscalability.com/youtube-architecture" rel="nofollow">http://highscalability.com/y... |
ipv4.fiddler, how does it work? <p>I'm curious as to how fiddler is able to capture traffic when you use the URL ipv4.fiddler. Is ipv4 a special domain that resolves local and fiddler just registers with http.sys to proxy the call?</p>
<p>Any insight would be great.</p>
| <p>Easy: Fiddler is a proxy, it gets to see almost(*) all of the requests. When it sees a request bound for "ipv4.fiddler", it simply changes it to 127.0.0.1.</p>
<p>(*)The only reason Fiddler needs this at all is that some HTTP stacks are hardcoded to bypass the proxy for "localhost" addresses. By using the magic s... |
Batch File Querying Registry in 64-Bit Vista <p>Hi guys me again :) I have a problem with a batch file I wrote. It works fine on 32-bit, but apparently it doesn't work on 64-bit systems, and I don't know why because I do not have access to a 64-bit system.</p>
<p>This is the code that works on Vista 32-bit system</p>
... | <p>There's no difference between batch files on x86 and x64 versions of Windows. The problem you have is due to WoW64 and transparent Registry redirection, see <a href="http://support.microsoft.com/kb/896459">here</a> for more details.</p>
<p><code>HKLM\SOFTWARE\Wow6432Node</code> is the correct registry key for 32bit... |
How to limit database flushing to disk? <p>I am using sqlite database in my arm9 embedded linux platform. I want to reduce writes to disk database because my disk is a flash memory and it needs minimum write cycles. So I tried to increment SQLITE_DEFAULT_CACHE_SIZE as 5000. My objective was to write data to cache and w... | <p>The latest <a href="http://www.sqlite.org/c3ref/backup%5Ffinish.html" rel="nofollow">SQLite has a feature for backing up hot databases</a> it's still experimental, but my recommendation would be to use an on Memory Database and merge it with the Disk database when you think is appropriate.</p>
|
Escape analysis in Java <p>As far as I know the JVM uses escape analysis for some performance <a href="http://www.ibm.com/developerworks/java/library/j-jtp10185/">optimisations</a> like lock coarsening and lock elision.
I'm interested if there is a possibility for the JVM to decide that any particular object can be all... | <p>With this version of java -XX:+DoEscapeAnalysis results in far less gc activity and 14x faster execution.</p>
<pre><code>$ java -version
java version "1.6.0_14"
Java(TM) SE Runtime Environment (build 1.6.0_14-b08)
Java HotSpot(TM) Client VM (build 14.0-b16, mixed mode, sharing)
$ uname -a
Linux xxx 2.6.18-4-68... |
Which are the features of C++0x that will remain for sure (if any)? <p>Are there any features of C++0x that are known to be there for sure?
Like, maybe, threads in the standard library?</p>
| <p>Actually none. At any point up to the publication of the standard, ISO can change it, since it's subject to the vagaries of the voting process.</p>
<p>In reality, any major feature that's currently in the draft will remain (although tweaking is possible). They've already stated that they'll miss their 2009 delivery... |
How do you configure WCF known types programmatically? <p>My client/server application is using WCF for communication, which has been great. However one shortcoming of the current architecture is that I must use known type configuration for certain transmitted types. I'm using an in-house Pub/Sub mechanism and this r... | <p>Add <a href="http://msdn.microsoft.com/en-us/library/system.servicemodel.serviceknowntypeattribute.aspx"><code>[ServiceKnownType]</code></a> to your <code>[ServiceContract]</code> interface:</p>
<pre><code>[ServiceKnownType("GetKnownTypes", typeof(KnownTypesProvider))]
</code></pre>
<p>then create a class called <... |
Sorting a graph to make as many arrows point forward as possible <p>I need to sort the nodes of a directed graph such that the number of arrows that flow backwards (against the sorting order) is minimal.</p>
<p>I can think of algorithms (e.g. keep swapping nodes until no swap will improve things) but I'm not sure how ... | <p>Sorting nodes in order of depth can be done with a <a href="http://en.wikipedia.org/wiki/Topological%5Fsorting" rel="nofollow">topological sort.</a> However, this will only work with graphs that contain no cycles. Your problem sounds like there are cycles in the graph. One option would be to find the cycles (see ... |
Git change '.git' folder name in windows <p>By default git init creates a folder called '.git'. In the recent Visual Studio tools (2005 and up) this works fine. But Visual Studio 2003 (and ... VB6 as well probably) crashes on this foldername. ideally I would like to change this per repository to something like 'git' in... | <p>The GIT_DIR variable allows you to specify another location for the repository.</p>
|
How to avoid showing loading text in Ext.form.ComboBox? <p>I use Ext.form.ComboBox in very similar way as in this example:
http://extjs.com/deploy/dev/examples/form/forum-search.html</p>
<p>What annoys me is that when the ajax call is in progress it shows loading text and I cannot see any results from before. </p>
<p... | <p>The solution is to override 'onBeforeLoad' method of Ext.form.ComboBox:</p>
<pre><code> Ext.override(Ext.form.ComboBox,
{ onBeforeLoad:
function() {this.selectedIndex = -1;}
});
</code></pre>
<p>Please be warned, that this overrides the class method, so all of the ComboBox instances will not hav... |
Clicking hyperlink doesn't work if there is a colon in the link. How can I solve this <p>In my application , users can post messages, a title and body. The message is then accessed by a user clicking the hyperlink of the title to read the message. However, if a colon is entered by the user the hyperlink is not clickabl... | <p>I think you need to do <a href="http://www.blooberry.com/indexdot/html/topics/urlencoding.htm" rel="nofollow">URL encoding</a> using <a href="http://msdn.microsoft.com/en-us/library/system.web.httpserverutility.urlpathencode.aspx" rel="nofollow"><code>HttpServerUtility.UrlPathEncode</code></a></p>
<p><strong>Edit</... |
How do you share Macros between Visual Studio 2008 Workspaces? <p>Kind of a newbie VS question :
I'm not certain it's called a workspace in VS, but when I log in as a different user on my PC, I notice that VS acts as it is in another 'workspace' (cf. Eclipse)</p>
<p>The custom codesnippets are managed seperately for ... | <p>I don't have an ideal solution, but what I've done is grabbed that vsmacros file and moved into somewhere else on the file system (say, c:\VsMacros). Then in Visual Studio, through the Macro Explorer, unload the existing MyMacros Macro Project by right-clicking on it. After unloading it, Right click "Macros" and L... |
Data synchronizing with SQL Server Management Studio <p>I was just about to buy redgate.com's compare package when I came to realize it seems highly unlikely a task like this isn't something that can be performed from the Management Studio.</p>
<p>I have a development database and I have a live database.
I develop my ... | <p>If you do it with management studio it's all restricted to your own head. YOU will have to keep track of all the changes etc. I find that Redgates SQL Compare 8 and SQL Data Compare 7 does the trick. I recently moved the structure of a production database over to something totally different within minutes thanks to ... |
ld can't find c file <p>I have a assembly file and a c file compiled to .o files (start.o and main.o) and is trying to link them with ld. I'm using this command:</p>
<pre><code>ld -T link.ld -o kernel.bin start.o main.o
</code></pre>
<p>where link.ld is a linker script, but when I run it, i get this error:</p>
<pre>... | <p>Some compilers (like GCC for Linux) don't add <code>_</code> by default to C library exports. Try <code>nm main.o</code> to see the actual reference name. It might be <code>main</code> rather than <code>_main</code>.</p>
|
How do I get the class of a object within a Django template? <p>If I have a list of objects that require similar layouts but need some attribute set based on the class of object how can I go about getting the class name while <strong>class</strong> and other <strong>xx</strong> values are not available within templates... | <p>You can also write a custom filter. My <a href="http://stackoverflow.com/a/14291933/1123985">use case</a> was to check whether or not an html element in a Django form was a checkbox. This code has been tested with Django 1.4.</p>
<p>I followed the instructions about <a href="https://docs.djangoproject.com/en/dev/ho... |
WPF: adding a usercontrol to a window <p>First off, I'm new to WPF and C# so maybe the issue I have is really easy to fix. But I'm kinda stuck at the moment.</p>
<p>Let me explain my problem.</p>
<p>I have a WPF Window and two usercontrols (Controls and ContentDisplayer).</p>
<p>The usercontrol Controls, wich contai... | <p>Google ranks this question high, but there's no accepted answer.</p>
<p>Try the answer to <a href="http://stackoverflow.com/questions/311131/add-wpf-control-at-runtime">this similar question</a>.</p>
|
Help with really odd Java GC behavior <p>I have a Java web app running on JBoss behind Apache (via mod_jk) and I'm seeing some really odd GC behavior. I've attached a graph of it to this question. Has anyone seen similar GC behavior before? It's Java 6 running with default GC tuning from ergonomics on a server-class ma... | <p>The problem seems to be that the system can't recover sufficient memory even after a full garbage collection. This also has the negative effect of promoting objects to tenured and survivor spaces that don't really belong there.</p>
<p>The size of the old generation should settle down over time, most objects are (or... |
c# check files on server using web client <p>C# 2008 </p>
<p>I have using the WebClient DownloadFile method.</p>
<p>I can download the files I want. However, the client has insisted on creating different folders which will contain the version number. So the name of the folders would be something like this: 1.0.1, 1.0... | <p>Create a page which gives you the current version number.</p>
<pre><code>string versionNumber = WebClient.DownloadString();
</code></pre>
|
sample code MoviePlayer problem <p>i have post this question before but cannot get a answer so i post it again.is about the MoviePlayer sample download from iphone developer site, when i press the Done button come with the movie player control mode, the movie was finish and exit to main view,at the same time the movieP... | <p>This problem is occurs only in the simulator not on the actual device.
If you want to get rid of this you need to release the MoviePlayer and allocate a new one each time you play a movie. E.g.:</p>
<pre><code>- (void) moviePlayBackDidFinish:(NSNotification*)notification
{
// remove observer
[[NSNotificati... |
private mercurial/git branch for backup? <p>Is it possible to create a non-visible branch in git or mercurial I can use as backup? Eg at the end of the day I have unfinished work (may even be left with syntax errors) but I want it to be backed up in the repository online, without annoying others about the mess that's l... | <p>By default <code>git clone</code> and <code>git fetch/merge</code> only download refs in refs/heads/*. So anything you push to somewhere else won't be downloaded by others (unless they explicitly ask for them or do something like <code>git clone --mirror</code>). So, for instance, you can do:</p>
<pre><code>git pus... |
Django caching for subdomains <p>I'm using <strong>subdomains</strong> in django for user pages via a <strong>middleware hack</strong> in a similar way to what is described <a href="http://stackoverflow.com/questions/624827/in-a-django-web-application-how-do-you-give-users-their-own-subdomain">here</a>:</p>
<p>Now, I ... | <p>Unfortunately, I can't address your primary issue (caching the subdomains) except to say that everything I have read implies that Django can't handle this in any elegant manner. Its possible this has changed for version 1.1, but if so I haven't come across anything about it. In my particular application I can't ca... |
Is it safe to drop and then create the constraints in the database <p>I am a bit confused and need your help. I have a database that has more than 150 tables. I have several fields which should support Unicode but right now they dont and therefore I want to change the column datatype to ntext and nvarchar in this proce... | <p>If you can do this without the database being live then it should be safe. Important things to bear in mind are making sure that you have all the constraints documented, that none of them will be affected by the change in column type (or if they are that you have mitigated for that) and that you are clear on the dep... |
Difference between JSP1.2 and JSP2.0 <p>Difference between JSP1.2 and JSP2.0</p>
| <p>See <a href="http://www.onjava.com/pub/a/onjava/2003/11/05/jsp.html" rel="nofollow">JSP 2.0 - The New Deal</a></p>
<p>To clarify, this article itemises in the first section the enhancements added to JSP 2.0.</p>
|
How to load an xml file from the model when the ControllerContext is null in ASP.Net MVC <p>I have a base controller abstract class, which my other controllers inherit. This class needs to load a local xml file in order to create some buttons for the master page. Given that the ControllerContext is null at this stage, ... | <p>I think the solution to your problem is a combination of what people have mentioned here. Override Initialize and load your XML document there. The Server property should be valid at that point. Also, use <em>Server.MapPath</em> to retrieve the resource from within your web site directory hierarchy.</p>
<pre><co... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.