instruction stringlengths 21 27.8k | chosen stringlengths 18 28.2k | rejected stringlengths 18 33.6k | __index_level_0__ int64 0 50k |
|---|---|---|---|
<p>I am very interested in streaming data for web-applications. I have tried out some javascript libraries, but the hacks and browser-incompatibilities drive me crazy ! HTML5 will hopefully standardize streaming data, but until then, hopefully I can resort to Flash to make this work in all browsers. Unfortunately, I'm ... | <p>Though I'm not familiar with what you're doing, it sounds like you should be looking at <a href="http://help.adobe.com/en_US/AS3LCR/Flash_10.0/index.html" rel="nofollow noreferrer">URLStream</a>. When you're loading things that Flash intuitively understands (MP3s, JPGs, SWFs and so on) then you would normally use a ... | <p>As Moss Collum and fenomas have suggested, there's <code>URLStream</code> and <code>XMLSocket</code>. But if you want to interact with a server on a binary level, you can read and write bytes with a <code>Socket</code> object.</p>
<p>Bear in mind that any network communication is subject to Flash Player's very rigi... | 47,834 |
<p>I'm using .NET 3.5, trying to recursively delete a directory using:</p>
<pre><code>Directory.Delete(myPath, true);
</code></pre>
<p>My understanding is that this should throw if files are in use or there is a permissions problem, but otherwise it should delete the directory and all of its contents.</p>
<p>However... | <p><strong>Editor's note:</strong> Although this answer contains some useful information, it is factually incorrect about the workings of <code>Directory.Delete</code>. Please read the comments for this answer, and other answers to this question.</p>
<hr>
<p>I ran into this problem before.</p>
<p>The root of the pro... | <p>None of the above answers worked for me. It appears that my own app's usage of <code>DirectoryInfo</code> on the target directory was causing it to remain locked.</p>
<p>Forcing garbage collection appeared to resolve the issue, but not right away. A few attempts to delete where required.</p>
<p>Note the <code>Dire... | 42,675 |
<p>I am using a GDI+ Graphic to draw a 4000*3000 image to screen, but it is really slow. It takes about 300ms. I wish it just occupy less than 10ms.</p>
<pre><code>Bitmap *bitmap = Bitmap::FromFile("XXXX",...);
</code></pre>
<p>//--------------------------------------------
// this part takes about 300ms, terrible!</... | <p>If you're using GDI+, the TextureBrush class is what you need for rendering images fast. I've written a couple of 2d games with it, getting around 30 FPS or so.</p>
<p>I've never written .NET code in C++, so here's a C#-ish example:</p>
<pre><code>Bitmap bmp = new Bitmap(...)
TextureBrush myBrush = new TextureBrus... | <p>I have made some researching and wasn't able to find a way to render images with GDI/GDI+ more faster than</p>
<pre><code>Graphics.DrawImage/DrawImageUnscaled
</code></pre>
<p>and at the same time simple like it.</p>
<p>Till I discovered</p>
<pre><code>ImageList.Draw(GFX,Point,Index)
</code></pre>
<p>and yeah i... | 33,167 |
<p>I am serializing a <code>JPEG</code> Image in <code>c#.net</code>. I am simply converting it into a byte steam and sending it through web service. </p>
<p>I observed that serialized byte stream is 30 times more than that of the size of actual image. Can any one <strong>suggest me a better approach</strong> to seria... | <p>JPEG is a compression technology, and it is expected that it will expand greatly once you read it in. This is the nature of the file format. Try to find a way to send the original JPEG file without reading it as an image first.</p>
| <p>Why not convert it to a Base64String?</p>
<pre><code>byte[] arr = File.ReadAllBytes(filename);
string str = Convert.ToBase64String(arr);
</code></pre>
<p>On the other end you can change it back to a byte[] by going:</p>
<pre><code>byte[] arr = Convert.FromBase64String(string);
</code></pre>
| 9,498 |
<p>I've created a PHP DOM xml piece and saved it to a string like this:</p>
<pre><code><?php
// create a new XML document
$doc = new DomDocument('1.0');
...
...
...
$xmldata = $doc->saveXML();
?>
</code></pre>
<p>Now I can't use the headers to send a file download prompt and I can't write the ... | <p>I see from the comments that you're working from within a CMS framework and are unable to stop content from being output prior to where your code will be.</p>
<p>If the script in which you're working has already output content (beyond your control), then you can't do what you're trying to achieve in just one script... | <p>You could enable output_buffering in your php.ini, then you might have some options with sending headers.</p>
<p><a href="http://us.php.net/manual/en/function.headers-sent.php" rel="nofollow noreferrer">http://us.php.net/manual/en/function.headers-sent.php</a></p>
| 24,732 |
<p>In C++, when is it best to use the stack? When is it best to use the heap?</p>
| <p>Use the stack when your variable will not be used after the current function returns. Use the heap when the data in the variable is needed beyond the lifetime of the current function.</p>
| <p>The question is ill formed.</p>
<p>There are situations where you need the stack, others where you need the heap, others where you need the static storage, others where you need the const memory data, others where you need the free store.</p>
<p>The stack is fast, because allocation is just an "increment" over the... | 12,751 |
<p>I am thinking of running this custom targets to find out more about my project build status
- jalopy
- jdepend
- cvs tagdiff report
- custom task for NoUnit
- generate UML diagram. ESS-Model</p>
<p>What are your views?</p>
| <p>I think that it's a great idea and use it myself. That way I'll never forget to run it.</p>
<p>I also keep the reports for a decent amount of time and eventually create a spreadsheet of "progress".</p>
<p>In your main ant task - call another task to do "whatever"
</p>
<p>and
JDepend.xml ...</p>
<p>
... | <p>I second the 'good idea' part, although for a project of reasonable size you might want to make it part of an automated build, like one of the CI Servers (Bamboo, Contiuum).</p>
<p>You might also consider a code coverage tool to see how your test coverage is going. </p>
<p>This will ensure the reports get run on a... | 29,363 |
<p>I have a python script that is a http-server: <a href="http://paste2.org/p/89701" rel="nofollow noreferrer">http://paste2.org/p/89701</a>, when benchmarking it against ApacheBench (ab) with a concurrency level (-c switch) that is lower then or equal to the value i specified in the socket.listen()-call in the sourcec... | <p>I cannot confirm your results, and your server is coded fishy. I whipped up my own server and do not have this problem either. Let's move the discussion to a simpler level:</p>
<pre><code>import thread, socket, Queue
connections = Queue.Queue()
num_threads = 10
backlog = 10
def request():
while 1:
con... | <p>I found <a href="http://www.mail-archive.com/dev@tomcat.apache.org/msg22589.html" rel="nofollow noreferrer">this article</a> on backlog on tomcat / java which gives an interesting insight in the backlog:</p>
<blockquote>
<p>for example, if all threads are busy
in java handling requests, the kernel
will handle... | 27,024 |
<p>I have a J2EE-based system which is running currently on Apache Tomcat. We are in discussions to move our production servers to the Glassfish server.</p>
<p>Can someone share their experiences with either of them?</p>
| <p>Here's <a href="https://rogerkeays.com/blog/glassfish-vs-tomcat" rel="nofollow noreferrer">quite an old comparison</a>. As such, the capabilities of each server have doubtless improved.</p>
<p>Edit: Here is <a href="http://wiki.glassfish.java.net/Wiki.jsp?page=GlassFishVsTomcat" rel="nofollow noreferrer">a current c... | <p>This may be a little dated and maybe even a little biased, but it's from Oracle. You can skip down to the section for comparing Glass Fish to Tom Cat</p>
<p><a href="http://java.sun.com/developer/technicalArticles/glassfish/GFandMySQL_Part1.html" rel="nofollow">http://java.sun.com/developer/technicalArticles/glass... | 42,488 |
<p>I am performing a lot of JavaScript work in the browser and would like to have some of that backend functionality in the front-end. Specifically, it would be nice to have the functions <code>get()</code>, <code>save()</code>, <code>all()</code> and <code>count()</code> available to the client. Additionally, it would... | <p>It sounds like you're looking for a complete JavaScript interface to the model and queryset APIs. I can't imagine that this would have ever been done or even be a simple task. Not only would you need to somehow generate JavaScript instances of models (much more than JSON serialisation provides, since you also want t... | <p>It sounds like you want to <a href="http://docs.djangoproject.com/en/dev/topics/serialization/?from=olddocs" rel="nofollow noreferrer">JSON encode</a> your object data. See <a href="http://www.json.org" rel="nofollow noreferrer">JSON.org</a> for more on the data format.</p>
| 24,702 |
<p>I'm new to ASP.NET MVC and I'm trying to get the full url to a action when working in a view. I need this to submit to a third party API as a callback. For example what I need is</p>
<blockquote>
<p><a href="http://myserver.com/controller/action" rel="noreferrer">http://myserver.com/controller/action</a></p>
</bl... | <p>In order to catch variations in the protocol (http / https), diffrent ports and virtual paths (can't always assume we will be in server root) I ended up with the following solution:</p>
<pre><code><%= Request.Url.GetLeftPart(System.UriPartial.Authority) + Url.Action("action", "controller")%>
</code></pre>
<p... | <p>Request.Url returns the full URL including the protocol (http://), the url (www.mydomain.com/mypath), and the querystring (?id=5).</p>
<pre><code>@Request.Url @*Razor tags*@
</code></pre>
<p>For classic ASP.NET MVC tags it would be</p>
<pre><code><%=Request.Url%> <%'Classic tags%>
</code></pre... | 45,138 |
<p>Did you ever had a bug in your code, you could not resolve? I hope I'm not the only one out there, who made this experience ...</p>
<p>There exist some classes of bugs, that are very hard to track down:</p>
<ul>
<li><strong>timing-related bugs</strong> (that occur during inter-process-communication for example)</l... | <p>Some things that help: </p>
<p>1) Take a break, approach the bug from a different angle. </p>
<p>2) Get more aggressive with tracing and logging. </p>
<p>3) Have another pair of eyes look at it.</p>
<p>4) A usual last resort is to figure out a way to make the bug irrelevant by changing the fundamental conditions... | <p>For memory related bugs i have found that the Memory Profiling options of Ants Profiler have helped me quite a bit on finding bugs.</p>
| 18,735 |
<p>Amazon announced cloud hosting for Windows goes public beta today. </p>
<p><a href="http://aws.amazon.com/windows/" rel="nofollow noreferrer">EC2 Windows Pricing</a></p>
<p>The pricing doesn't seem that cheap over colocation of your own server. Is this a revolutionary step towards the obvious future of hosting? </... | <p>This seems very expensive. To be honest I am quite disappointed for several reasons. Firstly they only support Windows 2003 Server. Windows 2008 has been out for long enough that surely they could support that by now. Secondly, they don't mention what version of SQL Server they are supporting but I am guessing it is... | <p>Seems expensive at $180 per full month for just a small SQL Express + IIS box + Authentication. I think the issue is you get billed full rate on partial hours. If they did away with that and let you be billed on per cpu hour consumed or similar then it might be better.</p>
<p>There are cheaper solutions out there s... | 28,737 |
<h2>Problem</h2>
<p>Our web host provider is changing the IP address of one of the servers we are on. We have been given a time frame for when the switch will take place, but no exact details. Therefore, our current <em>poor man's</em> check requires a periodic page refresh on a browser to see if our website is still t... | <p>If you can alert if the page is gone or does not have an expected value, you could use a script like</p>
<pre><code>$ip = 192.168.1.1
$webclient = new-object System.Net.WebClient
$regex = 'regular expression to match something on your page'
$ping = new-object System.Net.NetworkInformation.Ping
do
{
$result = $... | <p>This will list the IP Address for each network adapter in your system.</p>
<pre><code>Get-WmiObject -Class Win32_NetworkAdapterConfiguration -Filter IPEnabled=TRUE -ComputerName . | Select-Object -Property IPAddress
</code></pre>
| 22,957 |
<p>I seem to be in a never ending tail spin of Linux, or not, Windows or not. Web programming or system programming. Python or PHP.</p>
<p>I'am self teaching myself programming. But it seems I keep being torn about which way to go. Unfortunately it is always seemingly good reasons to get side tracked. You know the who... | <p>You will only have a first language for a little while. Pick any direction that interests you, and follow it. There is no way around the introduction "Drink from the Firehose" experience.</p>
<p>Keep early project simple, and tangible. Build useful things and the motivation will be there.</p>
<p>Web / desktop / mo... | <p>Don't worry so much about the direction you're going, just make sure that:</p>
<p>a) You are enjoying it, and are understanding what you are doing. You don't have to initially understand concepts like polymorphism for example, but you should be understanding the basics of what you are doing. Just can't wrap your mi... | 45,154 |
<p>I've never used any kind of source control before although I understand the concept. What I am confused about (and perhaps just not aware) is what benefit do I achieve and/or why would I want to configure Subversion and Apache? Do I need to configure it with Apache to be able to access my repositories from other com... | <p>There's no need to set up Subversion with Apache. I've used Subversion for years and have never had to do so (although there are reasons why you would, mostly to do with authentication infrastructure). Since you're in a Windows world, I've seen that <a href="http://www.visualsvn.com/server/" rel="nofollow noreferrer... | <p>You don't have to use Apache. There's a custom server - svnserve.exe can be used instead. It runs on port 3690 by default, but it can be set to a different port by using the <code>--port</code> switch when setting it up.</p>
<p>Greg Hewgill gave you a link which will tell you what version of the Subversion server t... | 30,837 |
<p>If I have a date, how do I calculate the week number for that date within that year?</p>
<p>For example, in 2008, January 1st to January 6th are in week 1 and January 7th to the 13th are in week 2, so if my date was January 10th 2008, my week number would be 2.</p>
<p>An algorithm would be great to get me started an... | <p>Pseudocode:</p>
<pre><code>int julian = getDayOfYear(myDate) // Jan 1 = 1, Jan 2 = 2, etc...
int dow = getDayOfWeek(myDate) // Sun = 0, Mon = 1, etc...
int dowJan1 = getDayOfWeek("1/1/" + thisYear) // find out first of year's day
// int badWeekNum = (julian / 7) + 1 // Get our week# (wrong! Don't use this)... | <pre><code>/**
* @brief WeekNo
* @param yr
* @param mon
* @param day
* @param iso
* @return
*
* Given a date, return the week number
* Note. The first week of the year begins on the Monday
* following the previous Thursday
* Follows ISO 8601
*
* Mutually equivalent definitions for week 01 are:
*
* ... | 34,635 |
<p>I want to provide some RSS feed(s) for my site. Is it worth providing Atom feeds? or is Atom the more common feed? Is there a winner?</p>
<p>BTW, this relates to programming because I'm required to program the feed which we will provide (or use some open source code, etc).</p>
<h2>Update</h2>
<p>So far it looks l... | <p>There are a few differences <a href="http://en.wikipedia.org/wiki/Atom_%28standard%29#Atom_compared_to_RSS_2.0" rel="noreferrer">there</a> which could be summed up :</p>
<ul>
<li>In Atom, the content can be specified (text, html) and can even be a binary (say, an audio track or a video) in base64 encoded form.</li>... | <p>I wouldn't say either has or will win. Most readers support both, so there's no real push for one to take over the other.</p>
<p>But, offering both is probably just a waste of effort. Just pick one, whichever you prefer -- from your comments, I'm guessing RSS.</p>
| 45,218 |
<p>I am looking for a bells and whistles CSS framework. I have found a number online that deal with "grids", and some that deal with "typography" and others that deal with "resetting".</p>
<p>What I have not found is something that will give my web applications a consistent reusable style or theme.</p>
<p>I guess it ... | <p><a href="http://acts-as-architect.blogspot.com/2008/11/introducing-compass.html" rel="nofollow noreferrer">Compass</a> really changes things for you.</p>
<p>In addition to providing everything from grids to mixins like horizontal-list, it's built on top of SASS so you get stuff like reuse and variables and other su... | <p>I found <a href="http://www.yaml.de/en/" rel="nofollow noreferrer">YAML</a> (Yet Another Multi-columned Layout) to be an excellent, comprehensive, highly adaptable all-rounder.</p>
| 41,742 |
<p>Can anyone suggest me on what data structure to use for a <a href="http://en.wikipedia.org/wiki/Soundex" rel="nofollow noreferrer">soundex algorithm</a> program? The language to be used is Java. If anybody has worked on this before in Java. The program should have these features:
be able to read about 50,000 words
... | <p>TIP: If you use SQL as a databackend then you can let SQL handle it with the two sql-functions SOUNDEX and DIFFERENCE.</p>
<p>Maybe not what you wanted, but many people do not know that MSsql has those two functions.</p>
| <p>Since soundex is a hash, I'd use a hash table, with the soundex as the key.</p>
| 34,039 |
<p>I'm using the <code>System.Windows.Forms.WebBrowser</code>, to make a view a-la Visual Studio Start Page. However, it seems the control is catching and handling all exceptions by silently sinking them! No need to tell this is a very unfortunate behaviour.</p>
<pre><code>void webBrowserNavigating(object sender, WebB... | <p>I haven't seen the browser eat exceptions, unless you mean script errors. Script errors can be enabled via the <code>browser.ScriptErrorsSuppressed</code> property.</p>
<p>If you're talking about real exceptions, not just script errors, can you show us some code that reproduces the problem? We've used the browser e... | <p>11 years late to the party here, but the following solution works for me.</p>
<p>In <code>webBrowserNavigating</code>, replace <code>MessageBox.Show(exception.ToString());</code> with <code>Dispatcher.BeginInvoke(() => { throw exception; });</code>.</p>
<p>As soon as the <code>webBrowserNavigating</code> method c... | 3,867 |
<p>I'm building a code in which I'd like to be able to generate an event when the user changes the focus of the cursor from an Entry widget to anywhere, for example another entry widget, a button...</p>
<p>So far i only came out with the idea to bind to TAB and mouse click, although if i bind the mouse click to the Ent... | <p>The events <FocusIn> and <FocusOut> are what you want. Run the following example and you'll see you get focus in and out bindings whether you click or press tab (or shift-tab) when focus is in one of the entry widgets.</p>
<pre><code>from Tkinter import *
def main():
global text
root=Tk()
... | <p>This isn't specific to tkinter, and it's not focus based, but I got an answer to a similar question here:</p>
<p><a href="https://stackoverflow.com/questions/165495/detecting-mouse-clicks-in-windows-using-python">Detecting Mouse clicks in windows using python</a></p>
<p>I haven't done any tkinter in quite a while,... | 25,843 |
<p>I'm looking for a tool ($, free, open source; I don't care) that will allow me to view not just the memory statistics for a .NET program, but also the object hierarchy. I'd really like to be able to drill down each thourgh each object and view it's foot print, as well as all the object's it references.</p>
<p>I've ... | <p>I have used JetBrains DotTrace and Redgate Ants, both of which I would recommend. A lesser known profiler I have also used is .Net Memory Profiler (<a href="http://memprofiler.com/" rel="nofollow noreferrer">http://memprofiler.com/</a>), which at the time I used it provided a different perspective on memory usage t... | <p><a href="http://www.jetbrains.com/profiler/" rel="nofollow noreferrer">JetBrains dottrace profiler</a> is the best. I wouldn't work without it. It is hard to find a tool that is free and performs well in this arena. Dottrace is hands down the best profiler I have used for .Net.</p>
| 7,296 |
<p>There are several web applications which allow you to send photos from your mobile phone and post them to web site/application. How do these work and what sort of technologies would one use to implement such a feature? Is it an MMS server or does one need to get into socket programming? For example, some applicati... | <p>I think you have three options to support this:</p>
<ol>
<li>MMS - you would need an <a href="http://www.google.com/search?hl=en&q=mms+gateway&btnG=Google+Search&aq=1&oq=mms+gate" rel="nofollow noreferrer">MMS gateway</a> to recieve MMS messages. This can be software/hardware that you run yourself, ... | <p>many popular phones including the iPhone unfortunately do not allow from the browser due to sandboxing, so you would either have to use a native application or one of the other methods</p>
| 20,636 |
<p>Generally, MVC frameeworks have a structure that looks something like:</p>
<pre><code>/models
/views
/controllers
/utils
</code></pre>
<p>However, in a web application suite, I've decided that clumping all models, views, and controllers together probably wouldn't be the best for clarity, unless I treated the syste... | <p>It seems like 2) would be your best option, assuming you want some separation of applications. You could also have a "/common" folder at the "/app#" level for shared resources across all applications... like a shared utility class or whatever.</p>
| <p>If your apps share data, it could make sense (to me) to group the models together. </p>
<p>However, for the views and controllers it probably makes more sense to keep them separate, since I'm assuming they have separate business logic and presentations.</p>
<p>Further, if your apps are kept separately in version ... | 21,501 |
<p>Automated tests MUST be fast to reflect real time project state. The idea is that:</p>
<ol>
<li>after any commit to repository automated build is performed (as fast as it can be done).</li>
<li>if build succeeded automated tests are started. MUST be fast.</li>
</ol>
<p>This is the best way i know to find out if yo... | <p>There are a number of optimization strategies you can do to improve the throughput of tests, but you need to ask yourself what the goal of this testing is, and why it needs to be fast.</p>
<p>Some tests take time. This is a fact of life. Integration tests usually take time, and you usually have to set up an environ... | <p>Buildbot: <a href="http://buildbot.net/trac" rel="nofollow noreferrer">http://buildbot.net/trac</a>
I can not recommend this enough if you're doing Continuous Integration (automated testing). With a quick configuration all of our unit tests are run each time there is a commit, and the longer integration tests get... | 22,328 |
<p>In my code segment, when I script the file name, it gives me a permission denied
on the following line: </p>
<pre><code>Set objTextFile = objFSO.OpenTextFile(strDirectory & strFile, ForAppending, True)
</code></pre>
<p>Here is the script </p>
<pre><code>'output log info
Function OutputToLog (strToAdd)
... | <p>I don't think this has to do with File Permissions per se. It has to do with the fact that you've created the file using:</p>
<pre><code>Set objFile = objFSO.CreateTextFile(strDirectory & strFile)
</code></pre>
<p>That creates the file...and carries a reference to that file (objFile)</p>
<p>Then you don't cl... | <p>balabaster is exactly right. You either need to close the file before reopening it a second time for writing, or using the existing open handle.</p>
| 48,222 |
<p>I'm going to have my website hosted soon on a VPS or dedicated server (with Windows 2008), so I'm trying to plan ahead. I wonder whether the built-in SMTP server that comes with IIS7 is reliable enough for a production server or should I look for an alternative? I heard good things about hmailserver and best of all ... | <p>I hit this thread via Google but I was looking for an outbound only SMTP server for transactional emails (customer registration confirmation etc. but not marketing), then some things I discovered are:</p>
<p>SMTP does still exist in Windows Server 2008.</p>
<p>Server Manager > Features (not Roles) > Right-click, A... | <p>Maybe sending it via gmail is a good one :P
Ok serious. <strike>IIS7 seems I heard to have some decent improvement.</strike> If that's not doing it, I guess you could try free stuff like mailenable.
(No I can't find the evidence on the improvement on IIS SMTP, people who know about this please comment)</p>
<p>Long ... | 34,583 |
<p>I've used MS Word automation to save a .doc to a .htm. If there are bullet characters in the .doc file, they are saved fine to the .htm, but when I try to read the .htm file into a string (so I can subsequently send to a database for ultimate storage as a string, not a blob), the bullets are converted to question m... | <p>On my system (using US-English) Word saves *.htm files in the Windows-1252 codepage. If your system uses that codepage, then that is what you should read it in as.</p>
<pre><code>string html = File.ReadAllText(originalFile, Encoding.GetEncoding(1252));
</code></pre>
<p>It is also possible that whatever you are usi... | <p>Did you try opening the file in binary mode. If you open in test mode I think it will chop up the unicode characters.</p>
| 34,402 |
<p>I need to read smallish (few MB at the most, UTF-8 encoded) XML files, rummage around looking at various elements and attributes, perhaps modify a few and write the XML back out again to disk (preferably with nice, indented formatting).</p>
<p>What would be the best XML parser for my needs? There are lots to choos... | <p>I think you should not consider any specific parser implementation. <a href="http://en.wikipedia.org/wiki/JAXP" rel="noreferrer">Java API for XML Processing</a> lets you use any conforming parser implementation in a standard way. The code should be much more portable, and when you realise that a specific parser has ... | <p>If you care less about performance, I'm a big fan of Apache Digester, since it essentially lets you map directly from XML to Java Beans.</p>
<p>Otherwise, you have to first parse, and then construct your objects. </p>
| 48,884 |
<p>When editing really long code blocks (which should definitely be refactored anyway, but that's beyond the scope of this question), I often long for the ability to collapse statement blocks like one can collapse function blocks. That is to say, it would be great if the minus icon appeared on the code outline for eve... | <p>Starting with Visual Studio 2017, statement collapsing is built-in.</p>
<p>There are several extensions that perform this task for pre-2017 versions of VS, starting with VS 2010 version:</p>
<ul>
<li><a href="http://visualstudiogallery.msdn.microsoft.com/4d7e74d7-3d71-4ee5-9ac8-04b76e411ea8" rel="noreferrer">C# ou... | <p># region ,#endregion is the smart option.</p>
| 36,229 |
<p>I want to use small flex charts with just 3 labels, for example a chart over the past 2 hours , with 3 horizontal label, as shown below:</p>
<pre><code> | | |
9:46 10:46 11:46
</code></pre>
<p>(of course, there are more than 3 values to display!)</p>
<p>I have been told this is not trivial... | <p>Take a look in the online <a href="http://livedocs.adobe.com/flex/3/langref/index.html" rel="nofollow noreferrer">Flex Language Guide</a> at the <a href="http://livedocs.adobe.com/flex/3/langref/mx/charts/AxisRenderer.html" rel="nofollow noreferrer">AxisRenderer</a> class. </p>
<p>It also has some helpful sample co... | <p>Have you looked at the CategoryAxis type? Using this you can explicitly set the labels.</p>
| 11,845 |
<p>Would someone explain how to get LINQ working with Sqlite.</p>
| <p><a href="http://code.google.com/p/dblinq2007/" rel="noreferrer">Here you have an SQL Linq provider for SQLite, and some other DBs</a></p>
| <p>Check this provider:</p>
<p><a href="http://kkubasik.wordpress.com/2007/10/25/sqllite-linq-provider/" rel="nofollow noreferrer">SqlLite Linq Provider</a></p>
<p>Also you can consider using <a href="http://www.microsoft.com/Sqlserver/2005/en/us/compact.aspx" rel="nofollow noreferrer">SQL Compact</a> which has very ... | 41,268 |
<p>How do I ask PowerShell where something is? </p>
<p>For instance, "which notepad" and it returns the directory where the notepad.exe is run from according to the current paths.</p>
| <p>The very first alias I made once I started customizing my profile in PowerShell was 'which'.</p>
<pre class="lang-sh prettyprint-override"><code>New-Alias which get-command
</code></pre>
<p>To add this to your profile, type this:</p>
<pre class="lang-sh prettyprint-override"><code>"`nNew-Alias which get-command" ... | <p>There also always the option of using which. there are actually three ways to access which from Windows powershell</p>
<ul>
<li>The first, (though not the best) is wsl(windows subsystem for linux)</li>
</ul>
<pre class="lang-sh prettyprint-override"><code>wsl -e which command
</code></pre>
<p>This requires installa... | 8,927 |
<p>I've often heard Ruby's inject method criticized as being "slow." As I rather like the function, and see equivalents in other languages, I'm curious if it's merely Ruby's <strong>implementation</strong> of the method that's slow, or if it is inherently a slow way to do things (e.g. should be avoided for non-small co... | <p><code>inject</code> is like <code>fold</code>, and can be very efficient in other languages, <code>fold_left</code> specifically, since it's tail-recursive.</p>
| <p><code>each_with_object</code> may be faster than <code>inject</code>, if you're mutating an existing object rather than creating a new object in each block.</p>
| 41,219 |
<p>I can't stand HTML intermixed with other code. I'm working on a codebase that has to remain in PHP, and I don't want to touch an HTML template with a proverbial pole. So what I'm currently doing looks like this:</p>
<pre><code><?php
$page = new html_page('My wonderful page');
$page->add_contents(new html_tag('... | <p>Well, the bottom line is, you're still mixing your HTML with your code. If you wanted to change that "p" tag to a "div", you'd have to wander through your code just to do it. Think about what your method offers:</p>
<ul>
<li>mixes code with HTML</li>
<li>adds overhead to parse all the requests</li>
<li>introduces a... | <p>Nobody else is doing it because it's quite a bit more work than just escaping in and out of PHP mode for a template file, not to mention it just adds overhead purely to satisfy your preference for code aesthetics.</p>
<p>This doesn't mean you can separate logic from display, such as a simple system like Owen sugges... | 32,884 |
<p>How can you check if a string is a valid GUID in vbscript? Has anyone written an IsGuid method?</p>
| <p>This is similar to the <a href="https://stackoverflow.com/questions/104850/c-test-if-string-is-a-guid-without-throwing-exceptions#104932">same question in c#</a>. Here is the regex you will need...</p>
<p>^[A-Fa-f0-9]{32}$|^({|()?[A-Fa-f0-9]{8}-([A-Fa-f0-9]{4}-){3}[A-Fa-f0-9]{12}(}|))?$|^({)?[0xA-Fa-f0-9]{3,10}(, {... | <p>there is another solution:</p>
<pre><code>try
{
Guid g = new Guid(stringGuid);
safeUseGuid(stringGuid); //this statement will execute only if guid is correct
}catch(Exception){}
</code></pre>
| 16,159 |
<p>I have a column containing the strings 'Operator (1)' and so on until 'Operator (600)' so far.</p>
<p>I want to get them numerically ordered and I've come up with</p>
<pre><code>select colname from table order by
cast(replace(replace(colname,'Operator (',''),')','') as int)
</code></pre>
<p>which is very very ug... | <p>It's that, InStr()/SubString(), changing Operator(1) to Operator(001), storing the n in Operator(n) separately, or creating a computed column that hides the ugly string manipulation. What you have seems fine.</p>
| <p>My answer would be to change the problem. I would add an operatorNumber field to the table if that is possible. Change the update/insert routines to extract the number and store it. That way the string conversion hit is only once per record.</p>
<p>The ordering logic would require the string conversion every tim... | 10,099 |
<p>I'm wondering if there is any way to create a User Account on a Windows XP machine that can be done through scripting from an ActiveX control on a webpage. Specifically, I'd like to know if there's any way to deploy an ActiveX control with computers (that I preconfigure and ship) that will allow use of my webpage f... | <p>There is a semicolon after <code>eval</code>.</p>
| <p>There is a semicolon after <code>eval</code>.</p>
| 39,042 |
<p>I want to stitch 2 pieces of png side by side. In Cocoa, I would use [NSImage initWithSize], and then just drawInRect. </p>
<p>But UIImage don't have initWithSize class, how would I do this now?</p>
| <p>Use <code>UIGraphicsBeginImageContext()</code>, draw in it, then use <code>UIGraphicsGetImageFromCurrentImageContext()</code>. Remember to pop the context with <code>UIGraphicsEndImageContext()</code> afterwards.</p>
<p>You should avoid creating an extra image if you simply want to display the two images onscreen, ... | <p>Apple's TheElements demo (AtomicElementViewController) has a great example on how to do this. And also how to create a reflection and bevelled look.</p>
| 26,867 |
<p>I'm developing a web app for an Apache shared hosting server. I have already written some code in Perl but I recently found out, to my surprise, the shared hosting provider does not provided mod_perl or a way to install it.</p>
<p>I have been a bit worried that running a Perl web app through CGI without mod_perl w... | <p>PHP would be faster.</p>
<p>However, with only 500 hits per day, using cgi would not be a problem. Not even with 500 hits an hour.</p>
| <p>It depends mostly on how complex your code is and how it's put together; if you run it as CGI, perl will compile your script and modules on each invocation, and will have to reconnect to your database for each request. If your code is complex enough, this may take a few seconds per pageview, which may hamper user ex... | 40,356 |
<p>I have a SelectList that I first check for a selected value != null and then want to use this selectedvalue in a where clause for a filter. Like so:</p>
<pre><code>if(searchBag.Qualities.SelectedValue != null){
ListItem selected = (ListItem)searchBag.Qualities.SelectedValue;
}
</code></pre>
<p>I made the cast ... | <p>It's never a good idea to use <code>DoCmd.RunSQL</code> as it generates a prompt (which you have to turn off if you don't want it), and it completes the updates even if errors occur, and doesn't report the errors. Much better is to replace it with a function that executes the same SQL:</p>
<pre><code>Public Functio... | <p>I don't see any way at this time to get the information after the update query has run unless you have another distinguishing field (maybe an updated date field). Why not run a select query for it and run a report off of that data, THEN run the update query to change the values for 'bonus'.</p>
<p>Let me know if t... | 43,283 |
<p>Many, if not all, of my old VC++ 6.0 MFC apps don't work in Vista and Server 2008. I had that migration was a problem, but now it's my problem :(</p>
<p>How do I go about making these things work? Is that possible? I've searched, but is there some repository of knowledge on this subject?</p>
<p>edit:
Compatibi... | <p>There should be specific reasons why they don't work, and of course, what exactly does not work. Maybe you should break each issue into a separate question (maybe here at SO) and tell us exactly what kind of problems you have when you try to run them, and what is the code that makes those errors show up.</p>
<p>Wit... | <p>There should be specific reasons why they don't work, and of course, what exactly does not work. Maybe you should break each issue into a separate question (maybe here at SO) and tell us exactly what kind of problems you have when you try to run them, and what is the code that makes those errors show up.</p>
<p>Wit... | 18,041 |
<p>What is the difference between a deep copy and a shallow copy?</p>
| <p>Shallow copies duplicate as little as possible. A shallow copy of a collection is a copy of the collection structure, not the elements. With a shallow copy, two collections now share the individual elements.</p>
<p>Deep copies duplicate everything. A deep copy of a collection is two collections with all of the e... | <p>Adding to all the above definitions, one more and most commonly used deep copy, is in the copy constructor (or overloading assignment oprator) of the class.</p>
<p>Shallow copy --> is when you are not providing copy constructor. Here, only the object gets copied but not all the members of the class are copied.</p>
... | 22,341 |
<p>Here's the sit:</p>
<ul>
<li>I have a JSF component which is basically a list of 'documents'</li>
<li>I have any number of document viewer components on the same page.</li>
<li>None of these components "know" about each other. In other words, they cannot be configured at design time to link to each other or anythin... | <p>I don't think there's a way of doing that with the standard JSF event model. </p>
<p>Is there any way you can bind the components to a backing bean? That way when an event happens you can just go through your list of components and notify each of them.</p>
| <p>ValueChangeEvent</p>
<p>I do not know how you implemented your document list but if it were say a dropdown or any other multi item list component you can do an Value Change Event and force a submit on change for the component. Then in the page code backing bean you can call the methods for your viewers to load what... | 32,189 |
<p>I'm embedding a JRE in an existing C application using the invocation API, and
I'd like to be able to use JDBC to work with the database in that code. This
application is a transaction processing application, and the database
transaction is managed by code in the C portion of the application, and the
java code must... | <p>Don't know whether this'll work, but... I had a quick look at the decompiled source code of Sun's JDBC-ODBC bridge. Seems like you could subclass the JdbcOdbcConnection so that it initializes itself with a known connection handle and an already-opened state. This assumes that the connection handles on the Java side ... | <p>Sun provides a <a href="http://java.sun.com/j2se/1.5.0/docs/guide/jdbc/bridge.html" rel="nofollow noreferrer">JDBC-ODBC bridge</a> in the JDK.</p>
<p>EDIT: Rereading sounds like you already know about it and don't want to use it.</p>
| 21,734 |
<p>I am trying to debug a web application through IIS that has a virtual directory other than localhost. It compiles fine but gets the above message anytime that I try to start debugging. I have compilation debug="true".</p>
| <p>Right click your 'web' project and select 'property pages'. Then change 'Start Options' to 'Don't open a page. Wait for a request from an external application.' and for server, select 'Use custom server' with Base URL: '<a href="http://localhost/your_virtual_dir/" rel="nofollow noreferrer">http://localhost/your_vir... | <p><a href="http://msdn.microsoft.com/en-us/library/dwesw3ee.aspx" rel="nofollow noreferrer">Error: Unable to Start Debugging on the Web Server</a></p>
<p>Check the points in the MSDN article above. IME, its normally one of these things:</p>
<ol>
<li><p>Has the application directory been created as an application in ... | 32,352 |
<p>I am looking to have 4 Virtual servers(various linux flavors) running on a Windows server 2003 R2 64 bit edition server located at a datacenter. I can also purchase a 2008 server or 32 bit 2k3 if needed. They would each have their own ip address for networking so that they could be publicly accessed. I do not kno... | <p><a href="http://technet.microsoft.com/en-gb/bb738033.aspx" rel="nofollow noreferrer">Virtual Server 2005 R2 SP1</a> is free (registration required) and supports x64 hosts. It does not support x64 guests.</p>
<p>Windows Server 2008 includes Hyper-V, Microsoft's new virtualization technology, which supports x64 guest... | <p>Unfortunately, the only way you are going to get decent performance is by using Linux as the host and Windows as the guest. The signed driver requirement on x64 essentially prevents any open source implementation from having reasonable performance.</p>
| 10,468 |
<p>Is there a tool, method or setting in the standard VBA Editor to warn about variables that have been <code>Dim</code>'med, but aren't being used?</p>
| <p><a href="http://www.mztools.com/index.aspx" rel="noreferrer">MZ-Tools</a> will search through your code and tell you what is not being used. The version for VBA can be found <a href="http://www.mztools.com/v3/mztools3.aspx" rel="noreferrer">here</a>.</p>
<p>The specific feature in MZ-Tools that performs what you as... | <p>Another method (because I don't have admin privileges to install that software), is to put <code>Option Explicit</code> at the top of your module. Then comment out all the <code>Dim</code>'med variables, and debug through your code with <kbd>F8</kbd> or recompile with <kbd>Alt</kbd>+<kbd>d</kbd>+<kbd>l</kbd></p>
<p... | 22,914 |
<p>Is there a NAnt task that will echo out all property names and values that are currently set during a build? Something equivalent to the Ant <a href="http://ant.apache.org/manual/Tasks/echoproperties.html" rel="noreferrer">echoproperties</a> task maybe?</p>
| <p>Try this snippet:</p>
<pre><code><project>
<property name="foo" value="bar"/>
<property name="fiz" value="buz"/>
<script language="C#" prefix="util" >
<code>
<![CDATA[
public static void ScriptMain(Project project)
{
... | <p>You can't prove a negative, but I can't find one and haven't seen one. I've traditionally rolled my own property echoes.</p>
| 16,998 |
<p>Could you guys recommend me a good db modeling tool? Mainly for SQL Server...</p>
<p>thanks!</p>
| <p>If it is for SQL Server I like the DB Diagram from SQL Server Management Studio.</p>
| <p>I used pencil and paper quite successfully to get the initial entities and relationships down. Especially good if designing with other people, you don't get distracted by the GUI interface, mousing around, getting the background gradients right, etc. Then you can translate it into Visio or Dia or a UML tool that gen... | 20,120 |
<p>I am new to git. I am wondering whether the following scenario is supported, and if so how (i.e. git commands for setup and update).</p>
<p>A repository is available from three different places: 'local', 'mirror' and 'github'. 'mirror' mirrors 'local' completely and 'github' mirrors 'local' except for a 'copyrighte... | <p>A submodule can work, but if you try to clone something that contains submodules for which one of the remotes is unavailable, you'll have aggravating errors.</p>
<p>My alternative would be to use the 'filter-branch' command to maintain a public branch that would omit the copyrighted files for public consumption on ... | <p>I think it is not possible.
What you can try is to put "copyrighted" directory in a separate branch which is not mirrored, but it will just make more hassle.</p>
| 35,134 |
<p>Using ASP.net 2.0, how do I present the information to the user similar to the Questions list on SO where each question has some child items (like the tags).</p>
<p>I would probably be making two separate queries, one to first find the list of questions, then another query to find all tags which belonged to the lis... | <p>I would definitely avoid the second approach - you don't want to hit the database everytime you databind a parent item. As DOK says, try and architect your system properly. For me that would mean populating a collection of business objects and binding to it. I do something similar with a custom menu control (note th... | <p>If you do two separate queries, you can still make them in one call to the database, and get back two resultsets.</p>
<p>Instead of DataSets, you could use the more efficient DataReader (with two resultsets). Loop through the resultsets and populate Question objects with associated Tag objects or properties. Put th... | 34,814 |
<p>I am using the Entity Framework and Linq to Entities. I have created a small database pattern & framework to implement versioning as well as localization. Every entity now consists of two or three tables, (ie Product, ProductBase & ProductLocal). </p>
<p>My linq always includes the following boilerplat... | <p>Yes.</p>
<p>You can do this by defining an extension method named IsActive on IQueryable.
There is a property on IQueryable called "Expression" that returns an expression tree representing the chain of LINQ method calls that was generated from your query.</p>
<p>In your case that will look something like this:</p>... | <p>You need to use the DataLoadOptions class so that it automatically loads the foreign key relationships you specify on that object. That will make it so that it will automatically get the linked tables that you specify which is really what you're doing.</p>
<p>This page details how to do that and tells more about wh... | 26,697 |
<p>What is the purpose of the <code>strdup()</code> function in C?</p>
| <p>Exactly what it sounds like, assuming you're used to the abbreviated way in which C and UNIX assigns words, it <em><strong>duplicates strings</strong></em> :-)</p>
<p>Keeping in mind it's actually not part of the current (C17) ISO C standard itself<sup>(a)</sup> (it's a POSIX thing), it's effectively doing the same ... | <p>The strdup() function is a shorthand for string duplicate, it takes in a parameter as a string constant or a string literal and allocates just enough space for the string and writes the corresponding characters in the space allocated and finally returns the address of the allocated space to the calling routine.</p>
| 31,492 |
<p>Given the following HTML:</p>
<pre><code><select name="my_dropdown" id="my_dropdown">
<option value="1">displayed text 1</option>
</select>
</code></pre>
<p>How do I grab the string "displayed text 1" using Javascript/the DOM?</p>
| <pre><code>var sel = document.getElementById("my_dropdown");
//get the selected option
var selectedText = sel.options[sel.selectedIndex].text;
//or get the first option
var optionText = sel.options[0].text;
//or get the option with value="1"
for(var i=0; i<sel.options.length; i++){
if(sel.options[i].value == ... | <p>If you were using <a href="http://www.prototypejs.org" rel="nofollow noreferrer">Prototype</a>, you could get at it like this:</p>
<pre><code>$$('#my_dropdown option[value=1]').each( function(elem){
alert(elem.text);
});
</code></pre>
<p>The above is using a CSS selector that says find ... | 23,287 |
<p>Is it possible to send messages from a PHP script to the console in Eclipse? Has anyone attempted this already? I'm not very familiar with how the console works, so I'm not sure if there is a standardized method for communicating with it.</p>
| <p>If you look at...</p>
<p>Main Menu -> Run -> External Tools -> Open External Tools Dialog.</p>
<p>In there I have set up PHP Codesniffer with the following...</p>
<ul>
<li>Name : Code Sniffer</li>
<li>Location : /usr/bin/phpcs</li>
<li>Working Directory : ${workspace_loc}</li>
<li>Arguments : --standard=${resour... | <p>All output from an Eclipse external tool launch goes to the console by default, so if you execute a PHP script using an external tool launcher any output from the script will go to the console.</p>
<p>For example:</p>
<pre><code><?php
echo "Hello World\n";
?>
</code></pre>
<p>Will send "Hello World" to th... | 48,816 |
<p>I want to use a specific foreign language font for a Blackberry application. How is such a font created and loaded onto the Blackberry device?</p>
<p>For example: ਪੰਜਾਬੀ </p>
| <p>A quick google search shows that the same thing has been asked at <a href="http://www.blackberryforums.com/developer-forum/100107-using-custom-fonts.html" rel="nofollow noreferrer">blackberry forums</a>.</p>
<p>The solution they came up with is a class for loading the font from a <a href="http://www.fileinfo.net/ex... | <p>A quick google search shows that the same thing has been asked at <a href="http://www.blackberryforums.com/developer-forum/100107-using-custom-fonts.html" rel="nofollow noreferrer">blackberry forums</a>.</p>
<p>The solution they came up with is a class for loading the font from a <a href="http://www.fileinfo.net/ex... | 9,887 |
<p>I'm creating a plugin to a software that skins the form I created. However, the button are not skin based on them and a standard gray button is shown. Asking on the software forum pointed me that .NET forms control are owner-draw and therefor my button won't redraw with the correct style instead of creating a non ow... | <p>The controls in Windows.Forms are not owner-drawn, but rather system-drawn. This is how Windows paints them by default, be it a Button, TextBox or what else. You can override the drawing either by specifying that the control should be owner-drawn (that is: you are responsible for drawing it) - some controls support ... | <p>Have you tried setting the <code>FlatStyle</code> to another value, such as <code>Flat</code> or <code>Popup</code>, just to see if that stops it being skinned?</p>
<p>also setting <code>Flaststyle = Standard</code> (as opposed to system) might solve your problem</p>
| 45,113 |
<p>Is there a way to find a node matched on part of a value.</p>
<p>If I have the following:</p>
<pre><code><competition id="100" name="Barclays Premier League"/>
<competition id="101" name="CocaCola Championship" />
<competition id="102" name="CocaCola League 1" />
</code></pre>
<p>Given the strin... | <p>String handling is not something XSLT is amazing at but there are a few options.</p>
<p>In this case you might try:</p>
<pre><code>//competition[contains(@name,'Prem')]
</code></pre>
<p>see <a href="http://www.w3schools.com/Xpath/xpath_functions.asp#string" rel="noreferrer">here</a> for more options and details</... | <p>There is also a "matches" function, which uses regular expressions, but this is only available in XSL 2.0.</p>
| 42,825 |
<p>I'm trying to make a function that has a list of lists, it multiplies the sum of the inner list with the outer list.
So far i can sum a list, i've made a function sumlist([1..n],X) that will return X = (result). But i cannot get another function to usefully work with that function, i've tried both is and = to no ava... | <p>Is this what you mean?</p>
<pre><code>prodsumlist([], 1).
prodsumlist([Head | Tail], Result) :-
sumlist(Head, Sum_Of_Head),
prodsumlist(Tail, ProdSum_Of_Tail),
Result is Sum_Of_Head * ProdSum_Of_Tail.
</code></pre>
<p>where <code>sumlist/2</code> is a SWI-Prolog built-in.</p>
<p>Usage example:</p>
<... | <p>Here is a rewrite of <a href="https://stackoverflow.com/questions/349896/passing-results-in-prolog/353572#353572">Kaarel's answer</a> (that's the intention anyway!) but <a href="http://www.cs.mu.oz.au/255/last_semester/last_semester/prolog_course/md5/md5_accumulators.html" rel="nofollow noreferrer">tail-recursive</a... | 45,532 |
<p>I have an Access database in which I drop the table and then create the table afresh. However, I need to be able to test for the table in case the table gets dropped but not created (i.e. when someone stops the DTS package just after it starts -roll-eyes- ). If I were doing this in the SQL database I would just do... | <blockquote>
<p>I would reccomend sticking to what you know - PHP is more than capable.</p>
</blockquote>
<p>That's true of course, but:</p>
<blockquote>
<p>I don't mind, and I would even like to use this as an excuse, learning some new thing like Python or Ruby.</p>
</blockquote>
<p>Then writing a browser game ... | <p>I would reccomend sticking to what you know - PHP is more than capable.</p>
<p>I used to play a game called <a href="http://www.hyperiums.com/" rel="nofollow noreferrer">Hyperiums</a> - a text based browser game like yours - which is created using Java (it's web-based quivalent is JSP?) and servlets. It works fairl... | 4,564 |
<p>Is it possible to change how <kbd>Ctrl</kbd> + <kbd>Tab</kbd> and <kbd>Shift</kbd> + <kbd>Ctrl</kbd> + <kbd>Tab</kbd> work in Visual Studio? I have disabled the popup navigator window, because I only want to switch between items in the tab control. My problem is the inconsistency of what switching to the next and pr... | <p>In Visual Studio 2015 (as well as previous versions of VS, but you must install <a href="https://visualstudiogallery.msdn.microsoft.com/dbcb8670-889e-4a54-a226-a48a15e4cace">Productivity Power Tools</a> if you're using VS2013 or below), there are two new commands in Visual Studio:</p>
<p><em>Window.NextTab</em> and... | <p>I don't use Visual Studio (<em>yes, really, I don't use it</em>), but <a href="http://en.wikipedia.org/wiki/AutoHotkey" rel="nofollow noreferrer">AutoHotkey</a> can remap any hotkey globally or in a particular application:</p>
<pre><code>#IfWinActive Microsoft Excel (application specific remapping)
; Printing area... | 4,137 |
<p>As many of us know (and many, many more don't), C++ is currently undergoing final drafting for the next revision of the International Standard, expected to be published in about 2 years. Drafts and papers are currently available from the <a href="http://open-std.org/JTC1/SC22/WG21/" rel="noreferrer">committee websit... | <p><strong>auto</strong> keyword for variable type inferencing</p>
| <p>for the moment I have liked much of C++0x that I have played with:</p>
<ul>
<li>nullptr</li>
<li>static_assert</li>
<li>lambdas</li>
<li>shared_ptr and weak_ptr </li>
<li>unique_ptr</li>
<li>decltype and auto</li>
</ul>
<p>I havent tried <code><regexp></code>... I thought it was a huge idea... but I didn't e... | 16,669 |
<p>I've one plist file and I want to parse it and copy it's content into NSArray,and code that I am using for that is. </p>
<pre><code>NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask, YES);
NSString *documentsPath = [paths objectAtIndex:0];
NSString *fooPath = [documentsP... | <p>Depending on how you generated the .plist initially, you may run into problems if you try and read it back in as an array. The safest way to read a plist is using the NSPropertyListSerialization class: <a href="https://developer.apple.com/iphone/library/documentation/Cocoa/Reference/Foundation/Classes/NSPropertyList... | <p>Are you generating the file with <a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSArray_Class/Reference/Reference.html#//apple_ref/occ/instm/NSArray/writeToFile:atomically:" rel="nofollow noreferrer">writeToFile:atomically</a>: ? do you check that this returns true?</p>
| 42,762 |
<p>What would be the best way to avoid SQL injection on the C#.net platform.</p>
<p>Please post an C# implementation if you have any.</p>
| <p>There's no algorithm needed - just don't use string concatenation to build SQL statements. Use the SqlCommand.Parameters collection instead. This does all the necessary escaping of values (such as replacing <code>'</code> with <code>''</code>) and ensures the command will be safe because somebody else (i.e. Microsof... | <p>There's no algorithm needed - just don't use string concatenation to build SQL statements. Use the SqlCommand.Parameters collection instead. This does all the necessary escaping of values (such as replacing <code>'</code> with <code>''</code>) and ensures the command will be safe because somebody else (i.e. Microsof... | 31,029 |
<p>I normally in my projects use such these code:</p>
<pre><code>If user.IsInRole("Admin") Then
deleteButton.Visible = True
else
deleteButton.Visible = False
</code></pre>
<p>But I want to control roles, which can see this button in database.</p>
<p>For this purpose how should database design be?</p>
<p>Than... | <p>Make the design whatever you want to be, but in ASP.NET side implement your own MembershipProvider. This will translate your DB design into users/roles that .NET can use. After that you can use it as usually - with <code>user.isInRole("Admin")</code> :)</p>
| <p>Assuming you're using .NET, one way to do this is to implement your own Role and Membership Providers. Then, you could add functionality by implementing an interface that contained the items you wanted (I've just knocked this sample up off the top of my head, so I apologize if it seems a bit rough):</p>
<pre><code>... | 45,395 |
<p>I have a Winform with a BackgroundWorker. The BackgroundWorker, among other things, has to make an HTTP call to a page, fill out some data, submit the form, and retrieve the HTML that comes back after "clicking" the submit button. I've run into a number of roadblocks while doing this:</p>
<ol>
<li>Can't POST the da... | <p>Have you tried using <a href="http://msdn.microsoft.com/en-us/library/system.net.webclient.uploadvalues(VS.80).aspx" rel="nofollow noreferrer">WebClient.UploadValues</a> with the Method argument set to "GET" ?</p>
| <p>Don't use a background worker?</p>
<p>If you do that you can set the ApartmentState to what you want. Just remember to Invoke/BeginInvoke when pushing data back to any Form controls.</p>
| 45,647 |
<p>I have an Asp.Net 1.1 application that uses the following code to write out an image file to a pop up web page.</p>
<pre><code> Response.ContentType="image/tiff" 'Only for Tif files
Dim objStream As Object
objStream = Server.CreateObject("ADODB.Stream")
objStream.open()
objStream.type = 1
o... | <p>Well, it depends on your audience. But ideally, to support legacy browsers, you shouldn't assume they can handle a TIFF.</p>
<p>At the very least, load the TIFF, select the first frame (page), do a DrawImage into a new bitmap, save the bitmap as JPG to a memory stream, and send that to Response.</p>
<p>If you're not... | <p>Have you tried setting the <a href="http://www.ietf.org/rfc/rfc2183.txt" rel="nofollow noreferrer">Content-Disposition</a> to Inline?</p>
<pre><code>Response.AppendHeader("Content-Disposition", "inline");
</code></pre>
| 36,794 |
<p>I am writing a Rails app that processes data into a graph (using Scruffy). I am wondering how can I render the graph to a blog/string and then send the blog/string directly to the the browser to be displayed (without saving it to a file)? Or do I need to render it, save it to a file, then display the saved image f... | <p>I think you will be able to use <a href="http://www.railsbrain.com/api/rails-2.1.0/doc/index.html?a=M000271&name=send_data" rel="nofollow noreferrer">send_data</a> for this purpose:</p>
<pre><code>send_data data_string, :filename => 'icon.jpg', :type => 'image/jpeg', :disposition => 'inline'
</code></p... | <p>I wonder if sending direct to the browser is the best way? If there is the possibility that users will reload the page would this short circuit any cache possibilities? I ask because I really don't know.</p>
| 33,598 |
<p>I know of Rational Rose and we have got Rational Rose 6.</p>
<p>But I am looking for some other tools which are more usable, which do not complain that they are not running in Windows 98/2000 (when installed and run in WinXP) and has got better features as compared to Rational Rose 6.</p>
| <p>Check out <a href="http://www.sparxsystems.com.au/products/ea/index.html" rel="nofollow noreferrer">Enterprise Architect</a>. It's not expensive and does a lot of things well.</p>
| <p>I did check out Enterprise Architect on SpareX's web site but could not find any reference stating that it handles reverse engineering or code generation for VB6.</p>
| 47,969 |
<p>On a Linux box, the common interface names look like eth0, eth1, etc. I know how to find at least one IP address using <code>gethostbyname</code> or similar functions, but I don't know any way to specify which named interface I want the IP address of. I could use ifconfig and parse the output, but shelling out for t... | <pre class="lang-c prettyprint-override"><code>// Originally from http://www.tlug.org.za/wiki/index.php/Obtaining_your_own_IP_address
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <net/if.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <... | <p><strong>edit:</strong> I saw you don't like shelling. Then you can look at how ifconfig does its job (it extracts at least some information from /proc).</p>
<p>When you have interface name, you can do this (in your shell):</p>
<pre><code>ifconfig eth0 | grep 'inet addr' | sed -e 's/:/ /' | awk '{print $3}'
</code>... | 32,404 |
<p>I have a table in a RDLC report which is utilized as a subreport, and the first column of this table is a static string. Does anyone know how I can determine if a row is the first in the table. I tried using "=First("My String")" but it didn't work.</p>
| <p>Aggregate functions work with "Scope', referring to the paragraph scope in this MSDN article, might help...<br></p>
<p><a href="http://msdn.microsoft.com/fr-fr/library/ms252112(VS.80).aspx" rel="nofollow noreferrer"><a href="http://msdn.microsoft.com/fr-fr/library/ms252112(VS.80).aspx" rel="nofollow noreferrer">htt... | <p>=IIF((RowNumber(Nothing) Mod <>)=0)</p>
<p><> Indicate No of Rows Which you want To Display</p>
| 12,880 |
<p>I'm printing a lot of draft parts so I don't care if they fall apart in my fingers, I just need the shape. I can scroll to the Tune menu on my Ender 3 Pro console and set the speed to 200% and it doubles the speed. But when I set the Print Speed setting to 100 instead of 50 mm/s in Cura, it doesn't save much time, e... | <p>If you use a build surface such as PEI, acetone frosts your surface, leaving a white film appearance. If you have no additional surface on a glass or metal bed, it is incomplete cleaning. If incomplete cleaning, you could try isopropyl alcohol (IPA) immediately after acetone, followed immediately by a water based ... | <p>If you use a build surface such as PEI, acetone frosts your surface, leaving a white film appearance. If you have no additional surface on a glass or metal bed, it is incomplete cleaning. If incomplete cleaning, you could try isopropyl alcohol (IPA) immediately after acetone, followed immediately by a water based ... | 1,872 |
<p>Is possible to insert a line break where the cursor is in Vim without entering into insert mode? Here's an example (<code>[x]</code> means cursor is on <code>x</code>):</p>
<pre><code>if (some_condition) {[ ]return; }
</code></pre>
<p>Occasionally, I might want to enter some more code. So I'd press <kbd>i</kbd> to... | <p>For the example you've given, you could use <kbd>r</kbd><kbd>Enter</kbd> to replace a single character (the space) with Enter. Then, <kbd>f</kbd><kbd>space</kbd><kbd>.</kbd> to move forward to the next space and repeat the last command.</p>
<p>Depending on your autoindent settings, the above may or may not indent t... | <p>This mapping will break up any one-line function you have. Simply put your cursor on the line and hit 'g' in normal mode:</p>
<pre><code>:map g ^f{malr<CR>`a%hr<CR>`a
</code></pre>
<p>This assumes that you have a space after the opening brace and a space before the closing brace. See if that works for ... | 29,384 |
<p>I've got a function that runs a user generated Regex. However, if the user enters a regex that won't run then it stops and falls over. I've tried wrapping the line in a Try/Catch block but alas nothing happens.</p>
<p>If it helps, I'm running jQuery but the code below does not have it as I'm guessing that it's a li... | <p>Try this the new RegExp is throwing the exception</p>
<p>
Regex</p>
<pre><code> <script type="text/javascript" charset="utf-8">
var grep;
try {
grep = new RegExp("gr[");
}
catch(e) {
alert(e);
}... | <p>One option is to validate the user-generated expressions. That is; escape characters that you know will stall your script.</p>
| 14,677 |
<p>I want to show a large amount of data in a dataset, 100,000 records approx 10 columns, this consumes a large amount of ram 700MB. I have also tried using paging which reduces this by about 15-20% but I don't really like the Previous/Next buttons involved when using paging. I'm not writing the data to disk at present... | <p>The reality is that the end-user rarely needs to see the totality of their dataset, so I would use which method you like for presenting the data (listview) and build a custom pager so that the dataset is only fed with the results of the number of records desired. Otherwise, each page load would result in re-calling... | <p>I would suggest memory mapped files...not sure if .NET includes support for it yet.</p>
| 30,862 |
<p>I have a WCF service from which I want to return a DataTable. I know that this is often a highly-debated topic, as far as whether or not returning DataTables is a good practice. Let's put that aside for a moment.</p>
<p>When I create a DataTable from scratch, as below, there are no problems whatsoever. The table is... | <p>For anyone having similar problems, I have solved my issue. It was several-fold.</p>
<ul>
<li>As Darren suggested and Paul backed up, the Max..Size properties in the configuration needed to be enlarged. The SvcTraceViewer utility helped in determining this, but it still does not always give the most helpful error... | <p>I think Darren is most likely correct - the default values provided for WCF are laughably small and if you bump into them you end up with errors that can be difficult to track down. They seem to appear as soon as you attempt to do anything beyond a simple test case. I wasted more time than I'd like to admit debuggin... | 3,380 |
<p>I've been reading a lot lately about the next release of Java possibly supporting <a href="http://en.wikipedia.org/wiki/Closure_%28computer_science%29" rel="noreferrer">closures</a>. I feel like I have a pretty firm grasp on what closures are, but I can't think of a solid example of how they would make an Object-Or... | <p>As a Lisp programmer I would wish that the Java community understands the following difference: <strong>functions as objects vs. closures</strong>.</p>
<p>a) <strong>functions can be named or anonymous</strong>. But they can also be objects of themselves. This allows functions to be passed around as arguments, retu... | <p>Not only that benjismith, but I love how you can just do...</p>
<p>myArray.sort{ it.myProperty }</p>
<p>You only need the more detailed comparator you've shown when the natural language comparison of the property doesn't suit your needs.</p>
<p>I absolutely love this feature.</p>
| 7,299 |
<p>I am using a JSP bean and when I do an assignment to a new object, it gets over-written on a submit to the previous object.</p>
<pre><code><jsp:useBean id="base" class="com.example.StandardBase" scope="session" />
...
//base object id = 396
base = new Base()
//base object id = 1000
</code></pre>
<p>and on a... | <p>I'm not completely sure, but I think <code>base = new Base()</code> does not update the reference stored in the session scope. Therefore, the bean you created with the initial <code><jsp:useBean/></code> is still around while the one you create manually, and then updated, isn't.</p>
<p>Get rid of <code>base =... | <p>would changing scope from session to request fix this for you?</p>
| 38,384 |
<p>I've played with CVS a little bit and am not the most familiar with all of its capabilities, but a huge annoyance for me is trying to add new directories that contain more directories in them. Running "<code>cvs add</code>" only adds the contents of the current directory, and using "<code>cvs import</code>" didn't l... | <p>I found this worked pretty effectively:</p>
<p>First, add all the directories, but not any named "CVS":</p>
<pre><code>find . -type d \! -name CVS -exec cvs add '{}' \;
</code></pre>
<p>Then add all the files, excluding anything in a CVS directory:</p>
<pre><code>find . \( -type d -name CVS -prune \) -o \( -type... | <p>SVN definitely makes this trivial task, using a GUI like Tortoise is even easier, however.</p>
<p>This might be a good place to start: <a href="http://www-mrsrl.stanford.edu/~brian/cvstutorial/" rel="nofollow noreferrer">http://www-mrsrl.stanford.edu/~brian/cvstutorial/</a></p>
| 2,704 |
<p>I'm looking for a plugin-based application framework that is comparable to the Eclipse Plugin Framework, which to my simple mind consists of:</p>
<ol>
<li>a core <strong>plugin management framework</strong> (Equinox / OSGI), which provides the ability to declare extension endpoints and then discover and load plugin... | <p>Can be considered...</p>
<p><a href="http://www.codeplex.com/CompositeWPF" rel="nofollow noreferrer">Composite Application Guidance for WPF and Silverlight</a></p>
<p><a href="http://msdn.microsoft.com/en-us/vstudio/bb510103.aspx" rel="nofollow noreferrer">Visual Studio 2008 Shell</a></p>
| <p>While I'm not familiar with the specifics of RCP, I think <a href="http://www.devexpress.com/Products/Visual_Studio_Add-in/DXCore/" rel="nofollow noreferrer">DxCore</a> is probably going to be the most complete framework for extending Visual Studio with managed code. It uses a plug-in based architecture and gives y... | 28,756 |
<p>I am having trouble with visible attribute of an ASP.NET <code>Panel</code> control. I have a page that calls a database table and returns the results in a datagrid.</p>
<h3>Requirements</h3>
<p>If some of the returned values are <code>null</code> I need to hide the image that's next to it.</p>
<p>I am using a <code... | <p>try:</p>
<p><code><%# String.IsNullOrEmpty(DataBinder.Eval(Container.DataItem,"addr1").ToString()) #></code></p>
| <p>try comparing the result of the eval to blank as opposed to null. </p>
| 49,650 |
<p>From my experience with <a href="http://en.wikipedia.org/wiki/OpenID" rel="nofollow noreferrer">OpenID</a>, I see a number of significant downsides:</p>
<p><strong>Adds a <a href="http://en.wikipedia.org/wiki/Single_Point_of_Failure" rel="nofollow noreferrer">Single Point of Failure</a> to the site</strong><br>
It ... | <p>The benefit of making OpenID mandatory is simply that login code for the website does not need to be written (beyond the OpenID integration), and no precautions need to be taken around storing user passwords etc.</p>
<p>Not having your own login code also means not having to deal with a lot of support issues like r... | <p>The main benefit of having an OpenID will be seen in the long term. Instead of having to apply to different sites for an identity, you do that once and then use it on all the sites that require a unique identity. Of course for secure sites like banking and trading it will need a different kind of thinking altogether... | 8,529 |
<p>Here's my situation.</p>
<p>I have a button on my ASP.NET webform. This button creates a new browser window pointing to a page which has a lot of hidden fields (which are dynamically generated). This form submits itself to SQL Reporting Services on the bodies onload event. This works fine and the report is displaye... | <p><strong>Don't</strong> close the browser. It belongs to the user, even if you opened it. Closing it can make them mad.<br>
<strong>Do</strong> redirect to a page the communicates to the user that you're done with the window. There you can provide a (javascript-based) link that make closing the browser a little ea... | <p>Generally it's ok to close any popup window that your app has created.</p>
<p>This can be done with <strong>window.close()</strong> (which will pop up a confirmation if the window was not created by script).</p>
<p>If you want to be sure that the download is successful before closing the window, you will need to p... | 21,813 |
<p>I'm wondering if people can suggest the best tutorial that will walk me through the best way to do Drag and Drop with control collision detection etc, using MS Silverlight V2.</p>
<p>I've done the <a href="http://silverlight.net/learn/tutorials.aspx" rel="nofollow noreferrer">Jesse Liberty tutorials</a> at Silverli... | <p>Here is a page that explained the solution for my use.</p>
<p><a href="http://www.adefwebserver.com/DotNetNukeHELP/Misc/Silverlight/DragAndDropTest/" rel="nofollow noreferrer">Silverlight 2 Drag, Drop, and Import Content Example</a></p>
| <p>A codeplex project for drag and drop <a href="http://www.codeplex.com/silverlightdragdrop" rel="nofollow noreferrer">http://www.codeplex.com/silverlightdragdrop</a></p>
| 9,563 |
<p>I just bought new eSUN PETg filament. When I started to extrude it, I heard popping sound same as moisture boiling out of it. I don't expect new eSUN vaccum sealed filament having moisture content. Is there any problem with my e3d v6? Is it possible that due to old filament, moisture is residing inside my extruder a... | <p>The extruder can't hold much water and transport it to the melt zone. Filament can. The printer behaves like the filament is wet, so try drying it. </p>
<p>Try putting the filament in your electric oven at the lowest temperature (often 170 °F to 180 °F) for an hour and see if the behavior impro... | <p>eSun has had quality problems recently (mid 2020), when they switched from the screw together clear reels to the molded black reels. I got an unprintable roll of PLA that was wet and brittle, others reported similar issues. This is theorized to have coincided with them moving production to Vietnam.</p>
<p>Try to dry... | 1,565 |
<p>Using The loader class of Adobe Flex, I load an external SWF file. However, the loaded SWF file has a different frameRate than my application.</p>
<p>Is it possible to have both the parent app and the loaded child app playing at different framerates? If so, how?</p>
| <p><a href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/LoaderInfo.html#frameRate" rel="nofollow noreferrer">It's not possible.</a></p>
<blockquote>
<p>Flash Player or Adobe AIR only uses a single frame rate for all loaded SWF files at any one time, and this frame rate is determined by th... | <p>If you decide to use events to drive your swf in order to approximate different frame rates I'd recommend using a tween engine like <a href="http://blog.greensock.com/tweenmaxas3/" rel="nofollow noreferrer">TweenLite/TweenMax</a>.</p>
<p>It's free (as in beer) and I've used it very successfully for frame based twee... | 14,583 |
<p>I have read that it is possible to <a href="http://developer.imendio.com/projects/gtk-macosx/build-instructions" rel="nofollow noreferrer">build GTK+ on MacOS X</a>. I know that it's possible to create a <a href="http://developer.imendio.com/projects/gtk-macosx/creating-app-bundles" rel="nofollow noreferrer">bundle... | <p>Native looking widgets is quite complicated.
There's a beginning of quartz engine (for theming) found here <a href="http://git.gnome.org/browse/gtk+/tree/gdk/quartz" rel="nofollow noreferrer">http://git.gnome.org/browse/gtk+/tree/gdk/quartz</a>
For self-contained applications check out the newly released bundle on <... | <p>I'm not sure if I'm grokking all the details of your question, but looking at your problem in general (how do I deploy a python app on mac), I'm inclined to say that the answer is <a href="http://undefined.org/python/py2app.html" rel="nofollow noreferrer">py2app</a>. Basically this will bundle a python interpreter a... | 14,380 |
<p>Is it possible to create a simple 3D model (for example in 3DS MAX) and then import it to Android?</p>
| <p>That's where I got to:</p>
<ul>
<li>I've used Google's APIDemos as a starting point - there are rotating cubes in there, each specified by two arrays: vertices and indices.</li>
<li>I've build my model using Blender and exported it as OFF file - it's a text file that lists all the vertices and then faces in terms o... | <p>Not sure about Android specifically, but generally speaking you need a script in 3DS Max that manually writes out the formatting you need from the model.</p>
<p>As to whether one exists for Android or not, I do not know.</p>
| 25,008 |
<p>I am using C# 2.0 with Nunit Test. I have some object that needs to be serialized. These objects are quite complex (inheritance at different levels and contains a lot of objects, events and delegates).</p>
<p>How can I create a Unit Test to be sure that my object is safely serializable?</p>
| <p>Here is a generic way:</p>
<pre><code>public static Stream Serialize(object source)
{
IFormatter formatter = new BinaryFormatter();
Stream stream = new MemoryStream();
formatter.Serialize(stream, source);
return stream;
}
public static T Deserialize<T>(Stream stream)
{
IFormatter formatte... | <p>Unfortunately, you can't really test for this. Imagine this case:</p>
<pre><code>[Serializable]
class Foo {
public Bar MyBar { get; set; }
}
[Serializable]
class Bar {
int x;
}
class DerivedBar : Bar {
}
public void TestSerializeFoo() {
Serialize(new Foo()); // OK
Serialize(new Foo() { MyBar = ne... | 29,278 |
<p>Why does it (apparently) make a difference whether I pass <code>null</code> as an argument directly, or pass an <code>Object</code> that I assigned the <em>value</em> <code>null</code>?</p>
<pre><code>Object testVal = null;
test.foo(testVal); // dispatched to foo(Object)
// test.foo(null); // compilation prob... | <p>Which version of Java are you using? With 1.6.0_11 the code (pasted below) compiles and runs.</p>
<p>I am sure its obvious why <code>foo(testVal)</code> goes to <code>foo(Object)</code>.</p>
<p>The reason why <code>foo(null)</code> goes to <code>foo(String)</code> is a little complex. The constant <code>null</code... | <p>Has anyone tried the example ???</p>
<p>With 1.6.0 foo(null) is dispatched to the most specific method applicable which is foo(String)...</p>
<p>If you add a new method say foo(Integer) the compiler cannot choose the most specific applicable method and shows an error.</p>
<p>-Patrick</p>
| 49,393 |
<p>Using C#, I need a class called <code>User</code> that has a username, password, active flag, first name, last name, full name, etc. </p>
<p>There should be methods to <em>authenticate</em> and <em>save</em> a user. Do I just write a test for the methods? And do I even need to worry about testing the properties s... | <p>Many great responses to this are also on my question: "<a href="https://stackoverflow.com/questions/24965/beginning-tdd-challenges-solutions-recommendations">Beginning TDD - Challenges? Solutions? Recommendations?</a>"</p>
<p>May I also recommend taking a look at my <a href="http://cantgrokwontgrok.blogspot.com/200... | <p>I can't speak for C# specificly, but when I write unit tests I test EVERY input, even those the user does not do, that way I know how to prevent my own mistakes.</p>
| 8,812 |
<p>The CSS rules <code>visibility:hidden</code> and <code>display:none</code> both result in the element not being visible. Are these synonyms?</p>
| <p><code>display:none</code> means that the tag in question will not appear on the page at all (although you can still interact with it through the dom). There will be no space allocated for it between the other tags. </p>
<p><code>visibility:hidden</code> means that unlike <code>display:none</code>, the tag is not ... | <p><code>display:none;</code> will neither display the element nor will it allot space for the element on the page whereas <code>visibility:hidden;</code> will not display the element on the page but will allot space on the page.
We can access the element in DOM in both cases.
To understand it in a better way please ... | 16,110 |
<p>I have a menu running off of a sitemap which one of the SiteMapNode looks like this: </p>
<pre><code><siteMapNode title="Gear" description="" url="">
<siteMapNode title="Armor" description="" url="~/Armor.aspx" />
<siteMapNode title="Weapons" description="" url="~/Weapons.aspx" />
</siteMa... | <p>you can nest CSS commands by listing them in sequence</p>
<p>siteMapNode siteMapNode { .... css code ... } would be applied to the inner node.</p>
<p>for instance, </p>
<p>#menu ul ul { ... }</p>
<p>would be applied to <br>
<ul> <-- not here<br>
<li><br>
</li><br>
</ul><br>
<div id=... | <p>The skin is applied through a .skin template.</p>
<pre><code><asp:Menu runat="server" CssClass="nav-bar" />
</code></pre>
| 15,270 |
<p>To do DataBinding of the <code>Document</code> in a WPF <code>RichtextBox</code>, I saw 2 solutions so far, which are to derive from the <code>RichtextBox</code> and add a <code>DependencyProperty</code>, and also the solution with a "proxy".</p>
<p>Neither the first or the second are satisfactory. Does somebody kn... | <p>There is a much easier way!</p>
<p>You can easily create an attached <code>DocumentXaml</code> (or <code>DocumentRTF</code>) property which will allow you to bind the <code>RichTextBox</code>'s document. It is used like this, where <code>Autobiography</code> is a string property in your data model:</p>
<pre><code>... | <p>This VB.Net version works for my situation. I removed thread collection semaphore, instead using RemoveHandler and AddHandler. Also, since a FlowDocument can only be bound to one RichTextBox at a time, I put in a check that the RichTextBox's IsLoaded=True. Let's begin with how I used the class in a MVVM app which us... | 44,665 |
<p>Unfortunately, the problem is not more specific than that. I've found a few examples of people reporting similar problems by doing <a href="http://www.google.com/search?source=ig&hl=en&rlz=&=&q=%22Unknown+object+in+backup+file%22&btnG=Google+Search&aq=f" rel="nofollow noreferrer">a Google sea... | <p>There's one bug logged at bugs.mysql.com that references the error you describe:</p>
<p>"<a href="http://bugs.mysql.com/bug.php?id=37253" rel="nofollow noreferrer">Bug #37253 Unable to restore backup file containing BLOBs</a>"</p>
<p>The solution described in that bug is to increase the <code>max_allowed_packet</c... | <p>I have had something similar in the past- it has something to do with how it was backed up. I think some applications put invalid comments in the backup files which cause errors. </p>
<p>My suggestion- if you are stuck trying to restore those files- is to incrementally start backing up from sections of the backup ... | 37,159 |
<p>We've got a page with a ton of jQuery (approximately 2000 lines) that we want to trim down b/c it is a maintenance nightmare, and it might be easier to maintain on the server. We've thought about using UpdatePanel for this. However, we don't like the fact that the UpdatePanel is sending the whole page back to the ... | <p>Don't move to UpdatePanels. After coming from jQuery, <a href="http://encosia.com/2007/07/11/why-aspnet-ajax-updatepanels-are-dangerous/" rel="noreferrer">the drop in performance</a> would be untenable. Especially on a page as complex as yours sounds.</p>
<p>If you have 2,000 lines of JavaScript code, the solutio... | <p>Using UpdatePanel force you to use ScriptManager that added tons of scripts in your webpages.
UpdatePanel provides you partial postback and not real ajax.
If your will run only on a LAN and not internet that's ok, but if your target is internet try refractoring your codes and compress them with some tools before pub... | 4,249 |
<p>I want to obtain the current number of window handles and the system-wide window handle limit in C#. How do I go about this?</p>
| <p>If you read Raymond Chen's post, you'll probably find it as annoying as I did. You're only "probably doing something wrong" because you're doing something Windows isn't capable of. </p>
<p>In my application, the first time a user visits a tab page, I create and lay out all the controls on that page. This takes a... | <p>The full quote OregonGhost refers to is</p>
<blockquote>
<p>If you have to ask, you're probably doing something wrong.</p>
</blockquote>
<p>It's from <a href="https://devblogs.microsoft.com/oldnewthing/20070718-00/?p=25963" rel="nofollow noreferrer">Why is the limit of window handles per process 10,000?</a> You ... | 17,298 |
<p>I'm looking for articles related Hypernate in .net</p>
<p>Can anyone recommend some?</p>
| <p>It seems unlikely that you're <em>really</em> after <a href="http://sourceforge.net/projects/hypernate/" rel="nofollow noreferrer">hypernate</a> (which appears to be a solo project without a release in 3 years). Did you perhaps mean <a href="http://www.nhibernate.org" rel="nofollow noreferrer">NHibernate</a>? If so,... | <p>I guess you are looking for articles about NHibernate (check the spelling)?
Search stackoverflow or google for NHibernate and you will find lots of articles.</p>
<p>The website of the NHibernate project is at <a href="http://www.nhibernate.org/" rel="nofollow noreferrer">http://www.nhibernate.org/</a> (but it seems... | 44,700 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.