input stringlengths 51 42.3k | output stringlengths 18 55k |
|---|---|
How to define the RouteTable in VB.NET? <p>[Route Table 1][1]
This image shows how to define the RouteTable in C#, using the Route Class. How to define it in VB.NET?</p>
| <p>I see you've asked a couple of questions about code conversion. There are free tools that help with this like:</p>
<p><a href="http://codechanger.com/" rel="nofollow">http://codechanger.com/</a></p>
<p>It'll be quicker than waiting for others to help you translate. There are some language features that don't get... |
Configure Easyphp to process htm files as php <p>On my remote server I'm using the line<br />
<code>AddType application/x-httpd-php .php .htm .html</code><br />
to parse the php in files with htm/html extensions<br />
How can I replicate this behaviour on my local machine running EasyPHP.<br />
I have tried adding the ... | <p>you need to add the same line in the conf_files/httpd.conf<br />
since the apache/conf/httpd.conf is regenerate each time you start your server.</p>
|
Best Practices for defining PatternLayout when using Log4j SyslogAppender <p>For those who are developing applications that are under PCI scope, where the guidance suggests that you should store your application logs on another tier, remoting to a syslog server elsewhere feels like a best practice.</p>
<p>The question... | <p>Depends on how they want to do their log reviews.</p>
<p>I would suggest a slightly different twist. Flatten the log events to an XML format (e.g. the log4j XMLLayout) and save the resulting XML-fragments.</p>
<p>This can then later be post processed easily, for instance by Log Parser</p>
<p><a href="http://www.... |
Entity Model does not load <p>Whenever i try to open my Entity Model, i get a not very helpful error message stating that "the operation could not be completed". So unfortunately i don't have more specific information. However, i have other models that open just fine, and i didn't make any significant changes to the mo... | <p>I guess i fixed it... </p>
<p>I was using inheritance, which can cause errors if you have a 0..1|... association on a derived entity. The fix for it is usually to set the association to a 1|... association, then do the inheritance, then change it back. </p>
<p>However in my case that somehow broke it, but then i l... |
IE6 transparency problem for dynamic images <p>I am trying to use the various techniques with dynamic png images i.e. images added after the page has been loaded using javascript DOM.</p>
<p>All of the techniques I tried seem to fail. Is there a reliable technqiue for the same?</p>
<p>Thank you very much for your tim... | <p>I've used <a href="http://www.twinhelix.com/css/iepngfix/" rel="nofollow">this fix from TwinHelix</a> on pretty complex websites with great success :)</p>
<p>One caveat through (this applies to all "fixes" i believe) is that you can not make a background image of an element be transparent.</p>
|
jQuery :FadeOut not working with table Rows <p>I have the following HTML table is rendered to my browser.I am creating this table from my ASP.NET codebehind file.</p>
<pre><code><table Class="tblTradeInCart">
<tr class="tblCartHeader">
<td>Item</td>
<td>Model</td>
<td> ... | <p>There is a problem in jQuery when hiding <code>trs</code>. This is the current workaround until they do something similar in the core, if they decide to.</p>
<pre><code>row.find("td").fadeOut(1000, function(){ $(this).parent().remove();});
</code></pre>
<p>This basically hides the <code>tds</code> in the row, ins... |
TSQL query to concatenate and remove common prefix <p>I have some data</p>
<pre><code>id ref
== ==========
1 3536757616
1 3536757617
1 3536757618
</code></pre>
<p>and want to get the result</p>
<pre><code>1 3536757616/7/8
</code></pre>
<p>so essentially the data is aggregated on id, with the refs c... | <pre><code>WITH hier(cnt) AS
(
SELECT 1
UNION ALL
SELECT cnt + 1
FROM hier
WHERE cnt <= 100
)
SELECT CASE WHEN ROW_NUMBER() OVER (ORDER BY id) = 1 THEN ref ELSE ' / ' + SUBSTRING(ref, mc + 1, LEN(ref)) END
FROM (
SELECT MIN(common) AS mc
... |
ASP.NET - Themes and Relative Referencing <p>I have an ASP.NET application that uses themes. Let's pretend I have a theme named "MySkin".</p>
<p>I have a page that is in a sub-directory of my application. When I reference a page that uses "MySkin", I noticed that ASP.NET renders a link element that walks up to the roo... | <p>According to the built-in internal class PageThemeBuildProvider, asp.net create relative path for css files included in the theme directory</p>
<pre><code>internal void AddCssFile(VirtualPath virtualPath)
{
if (this._cssFileList == null)
{
this._cssFileList = new ArrayList();
}
this._cssFile... |
Why is this regular expression match positive? <p>Given the pattern <code>^[a-zA-Z0-9 .\-_]+$</code> and the string <code>te\\st</code>, why is the match positive? I'm using this to validate usernames and I don't want people to put slashes in their usernames, it messes with URLs.</p>
<p>I'm calling <code>ereg($pattern... | <p><code>ereg</code> is crazy. I recommend avoiding it. You should try using <a href="http://www.php.net/preg%5Fmatch" rel="nofollow"><code>preg_match</code></a> for this:</p>
<pre><code>$count = preg_match('/^[a-zA-Z0-9 .\-_]+$/', 'te/\st', $matches);
print_r($matches); // empty array (no matches)
print $count; // 0 ... |
Update Panel Missing Data <p>I have a update panel with a gridview inside. The gridview works fine when it loads from the start (if i look at the "view source" all data is there), but when a postback is done on that updatepanel and click "view source" again the other data i fetched was not there. It still has the old d... | <p>View Source in browsers does not generally display any dynamic changes made to the HTML (i.e. changes resulting from an asynchronous post-back on an UpdatePanel). It will just give you the HTML that was received from the initial page request. If you're using Firefox, using Firebug to inspect the markup should show y... |
How to get the address of a value, pointed to by a pointer <p>I have a pointer to an int.</p>
<pre><code>int index = 3;
int * index_ptr = &index;
</code></pre>
<p><code>index_ptr</code> is a member variable of a class <code>IndexHandler</code>.</p>
<p>class A has a std::vector of IndexHandlers, Avector.
class B ... | <p>To print the address of an int pointer and the int value an int pointer points to, use</p>
<pre><code>printf("%p %i\n", ptr, *ptr);
</code></pre>
|
XSLT element in HTML element leads to errors <p>how can i realize something like this:</p>
<pre><code><img alt="logo" src="/Content/Images/Logos/<xsl:value-of select="/customer/country"/>.png" />
</code></pre>
<p>The XSLT processor throws an error because of the "<" - sign here...</p>
| <p>You can use: </p>
<pre><code><img alt="logo" >
<xsl:attribute name="src">
/Content/Images/Logos/<xsl:value-of select="/customer/country"/>.png
</xsl:attribute>
</img>
</code></pre>
|
Extract floating point numbers from a string in PHP <p>I would like to convert a string into floating numbers. For example</p>
<pre><code>152.15 x 12.34 x 11mm
</code></pre>
<p>into</p>
<pre><code>152.15, 12.34 and 11
</code></pre>
<p>and store in an array such that $dim[0]=152.15, $dim[1]=12.34, $dim[2]=11.</p>
<... | <pre><code>$str = '152.15 x 12.34 x 11mm';
preg_match_all('!\d+(?:\.\d+)?!', $str, $matches);
$floats = array_map('floatval', $matches[0]);
print_r($floats);
</code></pre>
<p>The <code>(?:...)</code> regular expression construction is what's called a <a href="http://www.regular-expressions.info/named.html">non-capturi... |
Jquery "THIS".myFuntionName is unavailable when in ajax Success? but ok before <p>can anyone help, i have an issue with the keyword this.. before entering the ajax call its available but when entering Success. my "this" is available but doesn't contain the same info i.e. a method i wish to call.. This example shows wha... | <p>its because the success function is executed in a different scope.</p>
<p>you need to do:</p>
<pre><code>var me = this;
$.ajax({
// etc
success: function(msg) {
var holidays = JSON.parse(msg.d, me.isoDateReviver);
</code></pre>
|
Java BitTorrent library <p>Are there any decent BitTorrent libraries for Java? I need to program a simple torrent client, but it would be great if I didn't have to write everything from scratch.</p>
| <p>Turn's <a href="http://mpetazzoni.github.io/ttorrent/">TTorrent</a> is a pure Java bit torrent library.</p>
|
How do I match a specific number in javascript? <p>I have a situation where, in javascript, I need to compare the contents of one string to see if it contains the exact same number in another string that could contain multiple numbers.</p>
<p>For example.</p>
<p>Source: "1234"
Comparison: "1000 12345 112345 1234 200... | <p>Use regex:</p>
<pre><code>"1000 12345 112345 1234 2000".match("\\b1234\\b")
</code></pre>
|
How do I access a config file inside the jar? <p>I'm using <a href="http://flatpack.sourceforge.net/">FlatPack</a> to parse and load data from flat files. This requires loading a config file that stores mappings of the columns of the flat file.</p>
<p>I have a constant to define the location of the mapping file:</p>
... | <p>if it's inside a JAR, it's not a File, generally speaking. You should load the data using <a href="http://java.sun.com/javase/6/docs/api/java/lang/Class.html#getResourceAsStream%28java.lang.String%29"><code>Class.getResourceAsStream(String)</code></a>, or something similar.</p>
|
How to reduce type declarations when using lambda parameters? <p>Below is a heavily cut down version of some code I have</p>
<pre><code>public class DataInfo<T>
{
public DataInfo(string description, Func<T, object> funcToGetValue)
{
this.description = description;
this.funcToGetValu... | <p>I'd create a builder class:</p>
<pre><code>public sealed class DataInfoListBuilder<T> : IEnumerable
{
private readonly List<DataInfo<T>> list = new List<DataInfo<T>>();
public void Add(string description, Func<T, object> function)
{
list.Add(DataInfo.Create&... |
How to release resources used by HttpPostedFileBase? <p>After I upload a file I try to delete it from my PC but it is saying that the file is in use.</p>
<p>What code am I missing to free the file to be deletable?</p>
| <p>You may need to close the InputStream manually after you read it to ensure that it is not held open until the HttpPostedFileBase is garbage collected.</p>
|
How to check for NaN in python? <p><code>float('nan')</code> results in a thingy simply called nan. But how do I check for it? Should be very easy, but i cannot find it.</p>
| <p><a href="http://docs.python.org/library/math.html#math.isnan">math.isnan()</a></p>
<blockquote>
<p>Checks if the float x is a NaN (not a number). NaNs are part of the IEEE 754 standards. Operation like but not limited to inf * 0, inf / inf or any operation involving a NaN, e.g. nan * 1, return a NaN.</p>
<p>... |
merged SQL table names <p>I have a merged table from several unions and i want to know from which of those tables the results were taken, is that possible?</p>
<p>example...</p>
<p>select name from users where name like '%alex%'
union
select name from admins where name like '%alex%';</p>
<p>Would return lets say t... | <pre><code>SELECT
Name,
'Users' AS Type
FROM users
WHERE name LIKE '%alex%'
UNION
SELECT
Name,
'Admins' AS Type
FROM admins
WHERE name LIKE'%alex%'
</code></pre>
|
Memory issue with iPhone game animations using image sequences <p>I am currently developing an iPhone game that has numerous animations using image sequences (jpg and png with transparencies). Using Instruments to view Leaks and Object Allocations, the most I've seen the object allocations go up to is less than 500k. H... | <p>This question may be of help <a href="http://stackoverflow.com/questions/924740/dispelling-the-uiimage-imagenamed-fud">Dispelling imageNamed FUD</a>.</p>
<p>Regarding the iPhone having 128mb you may want to check the last few posts at gamesfromwithin.com (by Noel Llopis) regarding the actual amount of RAM you're li... |
How to extract nested tables from HTML? <p>I have an HTML file (encoded in utf-8). I open it with <code>codecs.open()</code>. The file architecture is:</p>
<pre><code><html>
// header
<body>
// some text
<table>
// some rows with cells here
// some cells contains tables
</table>
... | <p>Try <a href="http://www.crummy.com/software/BeautifulSoup/" rel="nofollow">beautiful soup</a></p>
<p>In principle you need to use a real parser (which Beaut. Soup is), regex cannot deal with nested elements, for computer sciencey reasons (finite state machines can't parse context-free grammars, IIRC)</p>
|
How can I append characters to a line in a file? <p>I have a CSV file that was extracted from a ticketing system (I have no direct DB access to) and need to append a couple of columns to this from another database before creating reports off of it in Excel.</p>
<p>I'm using Perl to pull data out of the other database ... | <p>You could look at <a href="http://search.cpan.org/~jzucker/DBD-CSV-0.22/lib/DBD/CSV.pm" rel="nofollow">DBD::CSV</a> to treat the file as if it were a database (which would also handle escaping special characters for you).</p>
|
Can PHP mysql and mysqli module connections to the same database be used side-by-side safely? <p>Say one were looking at transitioning a codebase from using the basic PHP <code>mysql_*</code> functions to a <code>mysqli</code> implementation. Can connections to the same database be used side-by-side in both interfaces... | <p>They wouldn't share a connection, so transactions wouldn't work properly if you transitioned part of the transaction code to mysqli (e.g. if you called a function from within a transaction, and changed the function code to use mysqli but not the calling code).</p>
|
Hosting Multiple Service Contracts in IIS <p>How to host multiple service contracts in IIS. example , I have 3 different service contracts in my project and implements in three different class's. First I host a service contract in IIS with SVC file, now i want o host the another service in the same service. is it possi... | <p>Yes. Your .svc file refers to the service class. This class can implement multiple service contracts, simply by listing them. Abbreviated example:</p>
<pre><code>[ServiceContract]
public interface ICalculator // ...
[ServiceContract]
public interface IHelloWorld // ...
public MyMultiContractService : ICalculator,... |
Unit test and SQL database Connection <p>I am having a problem with a unit test I have created. First time doing this so I am not sure why I am getting this error</p>
<pre><code><DeploymentItem("ETDS.exe")> <DataSource("System.Data.SqlClient", "Data Source=Foo;Initial Catalog=FooDB;Integrated Security=True", ... | <p>Because you are using integrated security, the problem is most likely: "Who is running the test and what rights do they have to the network and/or the SQL Server?". If it's a local machine account, it probably won't even be allowed out over the network.</p>
<p>I noticed that your connection string does not have <c... |
Page.User.Identity.IsAuthenticated return always false in safari <p>I am using DotNetOpenId and Asp.NET MVC. I have the following problem:</p>
<p>When using IE not problem I can login and when I check the Page.User.Identity.IsAuthenticated I get true. If I test this in Safari for Windows the Page.User.Identity.IsAuthe... | <p>You <em>are</em> logging into your web site using Safari, right? I can't tell from your question whether you expect to be able to log in using IE and then switch to Safari and still be logged in. But that's certainly not possible. </p>
<p>Can you tell me more about what happens when you're using Safari? Does the... |
How to addClass to the first td in every tr inside a table using jQuery <p>I'm trying to add a class to the first td inside a tr within a specific class. But for some reason it adds this class only to the first td in the first tr -not the first td in each tr</p>
<pre><code>$("#appendTD").find("#gridFormInformation").... | <p>It looks to me like you're using a complicated manual way to find the tds you want to add the class to. I believe it would be easier to use jQuery selectors to find your tds.</p>
<p>Replace</p>
<pre><code>$("#appendTD").find("#gridFormInformation").children(0).children().each(
function() {
... |
How do you use foreach on a base class using generics? <p>This question is as a result of trying <a href="http://stackoverflow.com/users/22656/jon-skeet">Jon Skeet's</a> answer to <a href="http://stackoverflow.com/questions/944296/">this question</a>.</p>
<p>So I have the following code based in the question and answe... | <p>The problem here is that Order is a generic class, so <code>Order<T></code> and <code>Order</code> is basically two distinct types.</p>
<p>You can do this:</p>
<pre><code>public abstract class Order
{
public abstract String GetDeliveryMethod();
}
public abstract class Order<TDelivery> : Order
... |
Getting TortoiseSVN to set a file's modified time to the timestamp of the latest revision <p>I seem to remember being able to get <a href="http://en.wikipedia.org/wiki/TortoiseSVN">TortoiseSVN</a> to set the last-modified timestamp for files to the timestamp from the revision when performing an update. So if someone co... | <p>When I go to the Settings option in the TortoiseSVN menu, I see an option to "Set file dates to the last commit time." This may be what you're looking for.</p>
<h3>Invoke the Settings option</h3>
<p><img src="http://i.stack.imgur.com/j5RVq.png" alt="Screenshot of how to invoke the TortoiseSVN settings dialog"></p>... |
How can I script the creation of a movie from a set of images? <p>I managed to get a set of images loaded using Python. </p>
<p>I'd like my script to take this series of images (in whatever format I need them), and create a video from them. The big limit in all this is that I am looking for something easy and simple t... | <p>If you're not averse to using the command-line, there's the <code>convert</code> command from the ImageMagick package. It's available for Mac, Linux, Windows. See <a href="http://www.imagemagick.org/script/index.php">http://www.imagemagick.org/script/index.php</a>.</p>
<p>It supports a huge number of image formats ... |
Sleep function in c in windows. Does a function with better precision exist? <p>I was wondering if anyone knew of a better sleep function that could be used in windows in c, other than Sleep(), which takes a millisecond input and only guarantees that the input is the minimum amount of time that elapses. I am passing in... | <p>No, not really. When you tell your program to sleep, you're giving up the processor and letting the operating system decide what to do next. Once the operating system is in control, it decides when to give your program another slice of processing time. This is why you can specify a minimum, but there's no guarant... |
JDBC getConnection timeout issue <p>I have an application that uses connection pooling to get database connection from oracle9i release 9.2.0.4 database.Application is hosted in SJSAS 8.1 and the driver is ojdbc14.jar version 10.1.0.4. The problem I am having is datasource.getConnection() method is taking about 40 secs... | <p>Here's a few things to try:</p>
<p>From "Oracle® Database JDBC Developer's Guide and Reference".</p>
<p>Using JDBC with Firewalls</p>
<p>Firewall timeout for idle-connections may sever a connection. This can cause JDBC applications to hang while waiting for a connection. You can perform one or more of the follow... |
Delay when switching Controllers in ASP.NET MVC <p>Has anyone else found a noticeable delay when requesting a view that is under another controller?</p>
<p>For example, all actions under the same controller seem to respond quickly, but when I follow a link that leads to another controller there is a lag - almost like ... | <p>Well, ASP.NET uses JIT compiling. However, if this lag is consistently happening over and over, it may be another issue since once it's compiled the first time, it shouldn't recompile right away.</p>
|
How do I present a tree in an HTML table? <p>I'm trying to show a tree structure in an HTML table. It's basically a list of people you referred to a site, but you can expand each and see the people they referred too (only 2 or 3 levels).
I'm also showing a number of pieces of information on each person, so I'm using a ... | <p>I don't have an answer, but I have an illustration for those who have trouble visualizing OP's need.</p>
<p>Unix QPS (visual process manager) in Tree View shows just such a tree/table.</p>
<p>Google image search finds a few sample images.</p>
<p>Personally, would love to know how to implement this in a browser.</... |
how to delete carriage returns in html using php? <p>I'm using a javascript function that receives some html code that was included using php.
It is not html in a php string but an html file with .php extension.</p>
<p>As the html code is sent as a parameter to the js function it can't contain carriage returns. The pr... | <p>simple</p>
<pre><code>echo str_replace(array("\r\n", "\r", "\n"), null, $htmlCode);
</code></pre>
|
How to use a WSDL File to create a WCF Proxy? <p>I have an old WSDL file and I want to use WCF to communicate with the service. </p>
<p>The WSDL is generated from a ASMX (I suppose but I am not sure).</p>
<p>What would be the required steps to communicate with it ?</p>
| <p>Right-click your project, and choose "Add Service Reference". Point to the WSDL. Click "Ok". That should be all.</p>
<p><img src="http://i.stack.imgur.com/dZmcm.png" alt="enter image description here"></p>
|
Framework for doing (Igoogle/Pageflakes/netvibes)-like application using Ruby on Rails <p>Anyone has any suggestions of a framework to help me create an Igoogle/pageflakes/netvibes like application using ruby on rails.</p>
<p>I tried using <a href="http://apotomo.de/" rel="nofollow">apotomo</a> for a few days, but cou... | <p>now, try it again! that's for you:</p>
<p><a href="http://github.com/apotonick/dashboard%5Ftutorial" rel="nofollow">How to make a dashboard in Rails with Apotomo</a></p>
|
Why can I change a local const variable through pointer casts but not a global one in C? <p>I wanted to change value of a constant by using pointers.</p>
<p>Consider the following code</p>
<pre><code>int main()
{
const int const_val = 10;
int *ptr_to_const = &const_val;
printf("Value of constant is %... | <p>It's a constant and you are using some tricks to change it anyway, so undefined behavior results. The global constant is probably in read-only memory and therefore cannot be modified. When you try to do that you get a runtime error.</p>
<p>The constant local variable is created on the stack, which can be modified. ... |
Java classes that implement the Serializable interface <p>I need a list of classes that implement Serializable.
Could you also tell me what kind of classes implement that interface?</p>
| <p>In the Java API, most of the classes implement Serializable (<a href="http://java.sun.com/javase/6/docs/api/java/io/class-use/Serializable.html">here</a> is a full list). Classes that need to be <a href="http://en.wikipedia.org/wiki/Serialization">serialized</a> implement Serializable. You can use an IDE to find all... |
ASP Themes: Skin Localization <p>Is any way to localize text in .skin file (asp.net theme)?</p>
<p>Thanks</p>
| <p>Nope. Localized text comes from a resource file. Skin files pertain to the look and feel, not content.</p>
|
Overcoming a badly behaving Linux process? <p>I have a badly behaving process (launched via a user command) which keeps dying at erratic intervals, and I need it to stay alive till I manually kill it. Here is my straight, but probably stupid solution:</p>
<pre><code>#!/bin/bash
if [ -z $1 ]
then
echo "Usage: /s98ize... | <p>You can put it in /etc/inittab and init(8) will restart it for you automatically.</p>
<p>You can define in which runlevels the process runs, so it does not have to start at boot. You can also use a program like sed(1) to edit inittab programmatically and add a line to it, and then tell init(8) to reaload the config... |
C++\CLI exception specification not allowed <p>I'm an experienced unmanaged C++ developer, new to C++\CLI.</p>
<p>How come managed C++ doesnt allow exception specification?</p>
<p>Example <a href="http://bytes.com/groups/net-vc/285018-exception-specifications-legal-c-cli" rel="nofollow">link</a></p>
<p>What's the be... | <p>Presumably because the CLR doesn't use exception specifications; this in turn is presumably because Microsoft looked at Java and decided that they are far more trouble than they are worth.
So the best practice for specifying what exceptions your methods throw is to not bother, ie remove your exception specs. It's wo... |
Time and Nhibernate <p>hello i got an application that uses nhibernate as orm, i need to store data that represents time,
whats the best way to do it?</p>
<p>nhibenate dont know to convert time field from db to a timespan, only string.</p>
| <p>NHibernate supports <a href="https://www.hibernate.org/hib%5Fdocs/nhibernate/1.2/reference/en/html%5Fsingle/#mapping-types-basictypes">DateTime, Ticks, TimeSpan and Timestamp</a>. Make sure you are specifying the type explicitly on your mapping element as the different time types have different semantics so what NHi... |
Required tag in Custom MSbuild Tasks <p>How do you know if a value was passed in on a property that does not have the <code>[Required]</code> flag.</p>
<p>What will be the value of an string that is not required and was not passed in? If it is an empty string then how do you know the difference from a empty string se... | <p>If you need to know if a value was set or not then you can make a flag in your property for example</p>
<pre><code>public MyTask : Task
{
private string mName;
private bool mNameSet;
public string Name
{
get{return mName;}
set
{
mName = value;
mNameSe... |
Implementation details for SystemPropertiesAdvanced.exe (specifically SYSDM) <p>I'm investigating how C:\Windows\System32\SystemPropertiesAdvanced.exe on Windows 2008 interacts with explorer.exe when updating system environment variables. When updating environment variables this way, explorer.exe will dynamically upda... | <p>Pradeep Prem Kamal explains how to use <a href="http://msdn.microsoft.com/en-us/library/ms725497%28v=vs.85%29.aspx" rel="nofollow">WM_SETTINGCHANGE</a> and <a href="http://msdn.microsoft.com/en-us/library/ms644952" rel="nofollow">SendMessageTimeout</a> to update all top-level processes in his blog post <a href="http... |
what's the default order by for this query in MYSQL? <pre><code>mysql> explain SELECT p.id ID, p.job_desc_title Title, p.url URL, substr(p.posting_date, 1, 10) Date,
-> p.job_city_name City,
-> p.job_state_name State,
... | <p>Without an order by, the "default" ordering will depend on which indexes are used in the query and in what order they are used. This could change as the data/statistics change and the optimizer chooses different plans.</p>
<p>If you want the data in a specific order, use ORDER BY. But I'm sure you already knew th... |
Using Let in Scheme <p>I want to write a program to find the roots of the quadratic equation in Scheme. I used LET for certain bindings.</p>
<pre><code>(define roots-with-let
(λ (a b c)
(let ((4ac (* 4 a c))
(2a (* 2 a))
(discriminant (sqrt ( - (* b b) (4ac)))))
(cons ( / ( + (- b) dis... | <p>Use <code>let*</code> instead of <code>let</code>.</p>
<p>The difference between <code>let</code> and <code>let*</code> is the following:</p>
<p><code>let*</code> binds variables from left to right. Earlier bindings can be used in new binding further to the right (or down).</p>
<p><code>let</code> on the other ha... |
IoC, AOP and more <p>What is an IoC container?</p>
<p>What is an IoC/DI framework?</p>
<p>Why do we need a framework for IoC/DI?</p>
<p>Is there any relationship between IoC/DI and AOP?</p>
<p>What is Spring.net/ninject with respect to IoC and AOP?</p>
| <p>JMSA,</p>
<p>James Kovacs wrote a fantastic article which covers many of your questions I would recommend reading it <a href="http://msdn.microsoft.com/en-us/magazine/cc337885.aspx" rel="nofollow">Here</a></p>
<p>Spring.Net, Ninject, Unity, Castle Windsor, Autofac are all IOC containers which are configurable in d... |
Why does text drawn on a panel disappear? <p>I'm trying to draw a text on a panel(The panel has a background picture).</p>
<p>It works brilliant,but when I minimize and then maximize the application the text is gone.</p>
<p>My code:</p>
<pre><code>using (Graphics gfx = Panel1.CreateGraphics())
{
gfx.DrawString("... | <p>Inherit from Panel, add a property that represents the text you need to write, and override the OnPaintMethod():</p>
<pre><code>public class MyPanel : Panel
{
public string TextToRender
{
get;
set;
}
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
... |
Equivalent Javascript Functions for Python's urllib.quote() and urllib.unquote() <p>Are there any equivalent Javascript functions for Python's <a href="http://docs.python.org/library/urllib.html#urllib.quote"><code>urllib.quote()</code></a> and <a href="http://docs.python.org/library/urllib.html#urllib.unquote"><code>u... | <p>For the record:</p>
<pre><code>JavaScript | Python
-----------------------------------
encodeURI(str) | urllib.quote(str, safe='~@#$&()*!+=:;,.?/\'');
-----------------------------------
encodeURIComponent(str) | urllib.quote(str, safe='~()*!.\'')
</code></pre>
|
Hashtables/Dictionaries that use floats/doubles <p>I read somewhere about other data structures similar to hashtables, dictionaries but instead of using ints, they were using floats/doubles, etc.</p>
<p>Anyone knows what they are?</p>
| <p>If you mean using floats/doubles as keys in your hash, that's easy. For example, in .NET, it's just using <code>Dictionary<double,MyValueType></code>.</p>
<p>If you're talking about having the hash be based off a double instead of an int....</p>
<p>Technically, you can have any element as your internal hash... |
Difference between admin.site.root and admin.site.urls <p>In the <a href="http://www.djangobook.com/en/2.0/chapter06/" rel="nofollow">The Django Book</a> in chapter 6 about the Admin Site, they tell me to add the follwing URLpattern to urls.py:</p>
<pre><code>urlpatterns = patterns('',
# ...
(r'^admin/', inclu... | <p>Both Gabriel and Antti have it the wrong way round, unfortunately.</p>
<p><code>admin.site.root</code> is the version 1.0 behaviour. If you have downloaded 1.0 or 1.0.2, that's what you should use. </p>
<p>However, there were some changes to the URL handling for Django's admin very recently, which are part of the ... |
Can SMTP Errors be the Developer's fault? <p>I have an error message getting returned to me which would appear to be something wrong with the Exchange set up. Is there a possibility that I'm doing something wrong? I have no idea where to to start to track this down:</p>
<pre><code>The following recipient(s) cannot b... | <p>My guess is that you have the wrong user specified. Particular versions of Exchange are very picky about usersnames/emails. If you put just the "full name" in as the recipient, you won't get anything. You have to have an exact Match AND with Exchange 2000 you also needed an X.400 address to have it work too. </p... |
Allow access permission to write in Program Files of Windows 7 <p>My application throws 'Access denied' errors when writing temporary files in the installation directory where the executable resides. However it works perfectly well in XP. How to provide access rights to Program Files directory in Windows 7?</p>
<p>EDI... | <p>Your program should not write temporary files (or anything else for that matter) to the program directory. Any program should use %TEMP% for temporary files and %APPDATA% for user specific application data. This has been true since Windows 2000/XP so you should change your aplication.</p>
<p>The problem is not Wind... |
DSL: from DSL rules into C# expressions <p>the question is maybe composite, let me expand it:</p>
<ul>
<li>does it exists a <strong>designer</strong> (stub/framework/meta-designer) to create AND/OR based rules based on .NET object public bool properties? Saved as any DSL/Boo/... output.</li>
<li>is it possible to comp... | <p>You could build something like this your self.</p>
<p>You can get a list of all the public properties for a class using Type.GetMembers()</p>
<p>However, instead of generating C# code, I would use expression trees.</p>
<p>That way you don't need to involve the C# compiler when the users change rules. Instead, you... |
How can I pass an argument from a web page that is loaded inside a web browser applet in a C# program, back to the C# application? <p>This is a probably a dumb question but here is what I've got.</p>
<p>A web developer has a secure login page that after a user logs into it, a database reference is made and it grants r... | <p>InvokeScript.</p>
<p><a href="http://msdn.microsoft.com/en-us/library/cc491132.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/cc491132.aspx</a></p>
<p>Have the webmaster write something like this:</p>
<pre><code><script type="text/javascript">
function getPdfPath() {
return "/path/to/my.pdf"... |
How should a C++ programmer design software in C? <p>As a C++ programmer, we have to deal with concepts and the relation of related
concepts before implementing them to classes.</p>
<p>However,how to design a software in procedure languages like C ?
How can I deal with concepts without the help of class in C++.</p>
... | <p>If you are familiar with C++, you might want to consider creating a data struct anywhere you would create a class, and create functions similar to the class methods you might normally create, with the first parameter accepting a pointer to that struct.</p>
|
Where Is Browser Javascript Stored and Executed? <p>When javascript is run in a browser</p>
<pre><code>alert('Hello World');
</code></pre>
<p>What environment executes it and manages it in memory?<br/><br/>
I know this is vaugue! But thats the best place to start!</p>
| <p>The browser's javascript engine.</p>
<p><a href="http://ejohn.org/blog/javascript-performance-rundown/" rel="nofollow">Here's a page</a> that compares the performance of a bunch</p>
|
Asp.Net Login Control very slow initial connection to Non-Trusted AD Domain <p>ASP.NET Login control is very slow making the initial connection to AD when authenticating to a different domain than the domain the web server is a member of. Problem occurs for the IIS server and when using with the Visual Studio's built i... | <p>we finaly fixed it with</p>
<p>connectionProtection="None"</p>
<p>To turn off all attmepts to connetc on the secure port and only use 389.</p>
<p>We also had to specify the Connection username like "ad/bob" instead of just "bob" after the connetionProtection change.</p>
<p>Thanks,</p>
<p>Eric-</p>
|
MD5 Inverse Identity: Does (X,Y) exist such that md5(X)=Y and md5(Y)=X <p>Do there exist two 128-bit values that hash to each other?</p>
<pre><code>Find (X,Y) such that md5(X) = Y and md5(Y) = X
</code></pre>
<p>can they be found without brute force?</p>
<p>For extra credit:
Am I allowed to make up the term "md5-it... | <p>(Both answers were found while reading <a href="http://echochamber.me/viewtopic.php?f=12&t=29547" rel="nofollow">this link</a>)...</p>
<p>To answer question (1), consider the following:</p>
<blockquote>
<p>Brute forcing all md5(x)=x means checking 2.4x10^38 values. My quick test implementation can test some ... |
Recover empty SVN DB file <p>I tried to dump our SVN repository so I could migrate it to newer hardware. One of the revisions gave me a problem though so I tried to skip or "jump" that revision dumping from that number to a higher revision number but the problem persisted:</p>
<p>*svnadmin: Can't read file 'D:\reposit... | <blockquote>
<p>Is there any way to recover an empty
file ?</p>
</blockquote>
<p>Obviously the answer is <strong>no</strong>. You have to restore the revision file from your backups.</p>
<blockquote>
<p>or exclude it from the dump so it does
not affect highe revisions</p>
</blockquote>
<p>It is possible to g... |
GLPaint save image <p>I'm trying to develop a complex painting application on the iPhone. I'm currently drawing using Quartz (e.g. <code>CGContext</code>...). Unfortunately the Quartz overhead is just too slow for the type of drawing I'm doing, and I'm porting to OpenGL calls using the GLPaint example as a reference ... | <pre><code>-(UIImage *) saveImageFromGLView
{
NSInteger myDataLength = 320 * 480 * 4;
// allocate array and read pixels into it.
GLubyte *buffer = (GLubyte *) malloc(myDataLength);
glReadPixels(0, 0, 320, 480, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
// gl renders "upside down" so swap top to bottom into... |
Logger.DebugFormat in log4j <p>I'm used to working with the excellent log4net, and I assumed log4j is a direct port or ancestor.</p>
<p>I'm looking for an equivalent to the useful Logger.DebugFormat() family of methods, and I can't find anything like it. Is there anything like that in log4j (or similar packages)?</p>
... | <p>The answers of <a href="http://stackoverflow.com/questions/920458/what-is-the-best-practice-for-debug-statements-which-have-string-operations-in-th">this question</a> mentions a few options for format stringish logging in java.</p>
<p>I noticed <a href="http://code.google.com/p/log5j/" rel="nofollow">log5j</a> and ... |
How to use VScrollBar and HScrollBar together with a RichTextBox? <p>In my form I have a <code>RichTextBox</code>. I also have a <code>VScrollBar</code> and <code>HScrollBar</code>. I set the <code>RichTextBox</code> property <code>ScrollBars</code> to <code>None</code> so I can use the new scroll bars for it. Thats wh... | <p>I don't know if there is a way to do what you want. The best thing I can thing of would be to try and find the right position in the text, then Select() and ScrollToCaret(). I usually only use that trick to force a TextBox/RichTextBox to scroll to the very end, though. It wouldn't be very easy to use it for what ... |
Using Python's list index() method on a list of tuples or objects? <p>Python's list type has an index() method that takes one parameter and returns the index of the first item in the list matching the parameter. For instance:</p>
<pre><code>>>> some_list = ["apple", "pear", "banana", "grape"]
>>> so... | <p>How about this?</p>
<pre><code>>>> tuple_list = [("pineapple", 5), ("cherry", 7), ("kumquat", 3), ("plum", 11)]
>>> [x for x, y in enumerate(tuple_list) if y[1] == 7]
[1]
>>> [x for x, y in enumerate(tuple_list) if y[0] == 'kumquat']
[2]
</code></pre>
<p>As pointed out in the comments, t... |
How to use the POST command to send a file? <p>I would like to send a file using the POST command available on almost all linuxes which include Perl.</p>
<p>I'm wondering how.. </p>
<p>i would like to do something like :</p>
<pre><code>linux:currentdir/$ POST http://www.example.com/upload.php > myFileToUpload
</c... | <p>You might consider looking into Curl. It is much more robust. An example of automating a file-upload form submission would be:</p>
<pre><code><form method="POST" enctype='multipart/form-data' action="upload.cgi">
<input type=file name=upload>
<input type=submit name=press value="OK">
</form... |
Are there a Code Conventions for Assembly (mainly PIC)? <p>Are there a Code Conventions for Assembly (mainly PIC)?</p>
| <p>I was able to find the <a href="http://www.sourceformat.com/pdf/asm-coding-standard-brown.pdf" rel="nofollow">Assembly Language Style Guide(PDF)</a> which you might be interested in.</p>
|
Does a View Exist in Asp.Net MVC? <p>Does anybody know how if it's possible to determine if a specific view name exists from within a controller before rendering the view?</p>
<p>I have a requirement to dynamically determine the name of the view to render. If a view exists with that name then I need to render that vie... | <pre><code> private bool ViewExists(string name)
{
ViewEngineResult result = ViewEngines.Engines.FindView(ControllerContext, name, null);
return (result.View != null);
}
</code></pre>
<p>For those looking for a copy/paste extension method:</p>
<pre><code>public static class ControllerExtensions
{
publ... |
Custom foreach results for dynamic proxy class - magic methods? <p>I need to serialize a proxy class. The class uses __set and __get to store values in an array. I want the serialization to look like it is just a flat object. In other words, my class looks like:</p>
<pre><code>class Proxy
{
public $data = array();... | <pre><code>class Proxy implements IteratorAggregate
{
public $data = array();
public function __get($name)
{
return $data[$name];
}
public function getIterator()
{
$o = new ArrayObject($this->data);
return $o->getIterator();
}
}
$p = new Proxy();
$p->data = ... |
Tune 4 Windows Media Centers into the same audio stream <p>My goal is to be able to get all of the WMC pc's in my house playing the same music playlist at the same time. If I can't do it with the WMC software, I will bypass that and do something with WinAmp and a Shoutcast server running on one of them (or something, h... | <p>Media center supports up to 5 extenders, so its possible to play to 6 locations (including the media center itself at the same time).</p>
<p>You can achieve this for audio, but even a 100mb lan network isnt cabable of streaming 5 HD videos.</p>
<p>Its getting easier with DNLA devices, such as the Xbox 360 and the ... |
PHP (or other linux friendly) equivalent to .Net System.Xml.Linq <p>I've been working with the xml.linq classes in .net recently. But may need to use a linux friendly language for an upcoming project.</p>
<p>The things I like the most are</p>
<ol>
<li>Xdocument, being able to load from a
file or parse from a string <... | <p><strong>LINQ example thing in Python</strong></p>
<p><a href="http://themechanicalbride.blogspot.com/2007/03/linq-to-python.html" rel="nofollow">http://themechanicalbride.blogspot.com/2007/03/linq-to-python.html</a></p>
<p>But this blog sheds light on why this is not needed:</p>
<p><strong>LINQ in PHP</strong></p... |
WCF (Param encryption and .NET 1.1 clients) <p>I'm starting in the WCF world and would like to ask your opinion on something.
I need to implement a service exposing one method that receives a couple of parameters. I want the parameters, submitted from a form in the client to the service, to be sent encrypted in the SOA... | <p>There is no way for a .NET 1.1 application to call a WCF service unless that service is exposed through basicHttpBinding. That binding only permits the use of SSL for encryption.</p>
|
How can I find the OWNER of an object in Oracle? <p>I want to find the foreign keys of a table but there may be more than one user / schema with a table with the same name. How can I find the one that the currently logged user is seeing? Is there a function that gives its owner? What if there are public synonyms?</p>
| <p>You can query the ALL_OBJECTS view:</p>
<pre><code>select owner
, object_name
, object_type
from ALL_OBJECTS
where object_name = 'FOO'
</code></pre>
<p>To find synonyms:</p>
<pre><code>select *
from ALL_SYNONYMS
where synonym_name = 'FOO'
</code></pre>
<p>Just to clarify, if a <strike>user</strik... |
What is the appropriate output file from T-SQL query of table that has XML as datatype <p>I created a batch script that calls a T-SQL file and output it to text file. The T-SQL file contains select statement of a table to get the information of column with XML as datatype. The file will then be sent with either content... | <p>All you're missing is whitespace, and whitespace is irrelevant to real xml. Whatever reads that will treat it the same either way.</p>
|
asynchronous serial port communication in windows in c <p>I am getting an error when I try to run a c file which does some basic writes to a serial port. I am trying to run it asynchronously because the writes sometimes take a long time to transfer. My original version had it running synchronously with WriteFile() comm... | <p>I think you have a couple of issues:</p>
<p><hr /></p>
<p>You are passing an integer as a pointer (your compiler should warn against this or preferably refuse to compile the code):</p>
<blockquote>
<p>result = write_port(outPortHandle, 128);</p>
</blockquote>
<p>Compare this to the definition of write_port:</p... |
Installing Grails with Apache Camel plugin <p>I'm having trouble getting the Apache Camel plugin to run in grails-1.1.1. Here's the steps I took:</p>
<pre><code>$ grails create-app camelapp
Welcome to Grails 1.1.1 - http://grails.org/
...
$ cd camelapp
$ grails run-app
...
Running Grails application..
Server runnin... | <p>There's a <a href="http://jira.codehaus.org/browse/GRAILSPLUGINS-1253?page=com.atlassian.jira.plugin.system.issuetabpanels%3Aall-tabpanel" rel="nofollow">JIRA</a> on this problem. Try to just delete the @Override on the ClosureProcessor.java file. </p>
|
Aggregate Function not available as Article in Merge Rep Publication <p>I have Merge Replication set up and I just noticed that a Aggregate Function is not available on my Subscriber. After further investigation I discovered that is is not even available in the Publication as an option. There are other Functions list... | <p>To me it looks like a CLR user defined aggregate. To my knowledge those cannot be transfered using replication, but must be installed beforehand in each participating database.</p>
|
how to search for $exception and $ev special debugger variables on google or yahoo or bing <p>I want to find out more about the $ev special variable and special variables in general. Anyone know how to search to ensure <a href="http://www.google.co.nz" rel="nofollow">google</a> or <a href="http://www.bing.com" rel="nof... | <p>Make your search more specific by providing context, like <code>Visual Studio Debugger exception variable</code>. Search engines generally don't take punctuation into account for queries, with a few exceptions that have been specifically added as rules. (You can search for "<code>A+</code>", but not "<code>+A</code... |
Require client certificates appropriate for Directory Service Mapping (Active Directory)? <p>My MOSS 2007 instance (IIS 6) uses Windows Authentication and IIS' Directory Service Mapping (against Active Directory), allowing the user to authenticate using only her smartcard client certificate, without any username/passwo... | <p>I don't think you can change this. I believe the certificate selection screen is part of Internet Explorer.</p>
<p>If the user chooses a certificate that doesn't have a UPN associated, you could prompt the user to select another certificate and try again.</p>
<p>Edit: Since tapping into the MOSS security framework... |
Grant SeServiceLogonRight from script <p>I need to be able to grant rights to a user from a script (a batch file or JScript file). In particular, I want to grant SeServiceLogonRight to a particular domain account. I can't use NTRights.exe (not available on all target OS's), and I'd like to avoid having to write an exec... | <p>AFAIK, no. You need either NTRights.exe or a custom tool or automation object that wraps the appropriate LsaXXX WinAPI functions.</p>
|
ColdFusion CFHTTP Post is doing a second GET request right after <p>I am using ColdFusion 8.</p>
<p>I'm doing a CFHTTP Post to a remote server. The remote site has looked at their logs and they say my code is doing the POST, and then immediately doing a 2nd GET request.</p>
<p>Here is my code (the URL has been chang... | <p>I'm guessing the reason you get the second GET is that your CFOUTPUT outputs the retrieved page content into the browser, then when an image or something from that content is rendered from the retrieved page it acts as a GET.</p>
<p>Remember that CFHTTP is not stateful. By this I mean that each request with CFHTTP ... |
How to log exceptions in release mode <p>Stack trace is not enabled when a .net assembly is deployed in release mode. So we cannot get the stack trace from an exception and log it in production environment.</p>
<p>For knowing where an exception occurred in the production code and log it, we use a <a href="http://stack... | <p>Check out ELMAH, I haven't implemented it myself but it seems to be getting some attention.</p>
<p><a href="http://www.hanselman.com/blog/ELMAHErrorLoggingModulesAndHandlersForASPNETAndMVCToo.aspx" rel="nofollow">http://www.hanselman.com/blog/ELMAHErrorLoggingModulesAndHandlersForASPNETAndMVCToo.aspx</a></p>
<p>On... |
C# .NET Web Services - Passing custom objects to a web service <p>I have a need to pass a custom object to a remote web service. I have read that it may be necessary to implement ISerializable, but I've done that and I'm encountering difficulties. What is the proper way in C# to pass a custom object to a web service me... | <p>Looks like a duplicate to this <a href="http://stackoverflow.com/questions/347047/passing-a-custom-object-to-the-web-service">question</a></p>
<p>Anyway, all objects involved in WS interactions should be XML-serializable, not ISerializable (which is binary serialization). Moreover, they should be described in the s... |
F#: In real terms, what is the difference between a "string" and a "string option"? <p>In real terms, what is the difference between a "string" and a "string option"?</p>
<p>Aside from minor sytnax issues, the only difference I have seen is that you can pass a "null" to string while a string option expects a "none". <... | <p>I don't particularly like the answer I've typed up below, because I think the reader will either see it as 'preaching to the choir' or as 'some complex nonsense', but I've decided to post it anyway, in case it invites fruitful comment-discussion.</p>
<p>First off, it may be noteworthy to understand that</p>
<pre><... |
How to list contents of a server directory using JSP? <p>When writing a JSP file, how can I get the <strong>current directory</strong> of this file at runtime<br />
(to be able to iterate the directory and list its contents)?</p>
<p>Would some file I/O operations be restricted because of some security issues?</p>
<p>... | <pre><code> <%@page import="java.io.*" %>
<%@page import="java.util.*" %>
<%! public void GetDirectory(String a_Path, Vector a_files, Vector a_folders) {
File l_Directory = new File(a_Path);
File[] l_files = l_Directory.listFiles();
... |
How to save a Python interactive session? <p>I find myself frequently using Python's interpreter to work with databases, files, etc -- basically a lot of manual formatting of semi-structured data. I don't properly save and clean up the useful bits as often as I would like. Is there a way to save my input into the she... | <p><a href="http://ipython.scipy.org/moin/">IPython</a> is extremely useful if you like using interactive sessions. For example for your usecase there is the <em>%save</em> magic command, you just input <em>%save my_useful_session 10-20 23</em> to save input lines 10 to 20 and 23 to my_useful_session.py. (to help with ... |
Overriding JCS events <p>I am using Apache JCS in our application to cache commonly used data at application start-up. However, if some of the data in cache is not used till its idle time, I want to manually reload that value from database. </p>
<p>So, basically I want to over-ride the JCS events such that my java pro... | <p>Create an abstract class that registers the events your interested in capturing. This works for me to capture the two events.</p>
<pre><code>private static final Set<Integer> EVENTS = new HashSet<Integer>();
{
EVENTS.add(IElementEventHandler.ELEMENT_EVENT_EXCEEDED_IDLETIME_BACKGROUND);
EVENTS.add(IE... |
Multi-domain Subversion Deployment on Media Temple DV <p>This is a question pretty specific to Media Temple DV servers, but I'm hoping someone out there can help. Our deployment process on a DV server involves ssh'ing in and doing a Subversion checkout into a folder called "svn" and then creating a symlink in "httpdocs... | <p>You should be able to do this. Are you symlinking to the full path? (/var/www/vhosts/my-domain/svn/ ... ) What errors are you getting?</p>
<p>Why don't you do your SVN checkouts to separate directory (/var/www/vhosts/svn) and then do your symlinking to that? (ln -s /var/www/vhosts/svn/folder /var/www/vhosts/my-doma... |
S3 GET without Signing (Cleartext possible?) <p>Is there a way to GET a object from Amazon S3 by sending the cleartext Accesskey:Secret instead of signing/HMAC?</p>
| <p>Not unless the ACL is set for anonymous read access.</p>
|
FullTrust vs SkipVerification <p>What is the purpose of FullTrust when SkipVerification exists?</p>
<p>I understand that FullTrust will give an assembly full access to any limitation that can be implemented through a CAS permission check. What I don't understand is why anyone would ever use it. We have access to SkipV... | <p>It's not the same. From MSDN:</p>
<blockquote>
<p>During just-in-time (JIT) compilation,
an optional verification process
examines the metadata and Microsoft
intermediate language (MSIL) of a
method to be JIT-compiled into native
machine code to verify that they are
type safe. This process is skipped ... |
prism switch between views in the same region <p>I have a region named "ActiveModule" and want to re-use it with different views, for example you press the search button and I show the search view in there, etc. etc.</p>
<p>The only way I can ATM do that is to deactivate all the active views in that region and then ac... | <p>If your region is a ContentControl or derives from ContentControl, then there can only be one active view at a time, and you only need to activate the search view on the region.</p>
|
Objective C two-phase construction of objects <p>I've been reading up on RAII and single vs. two-phase construction/initialization. For whatever reason, I was in the two-phase camp up until recently, because at some point I must have heard that it's bad to do error-prone operations in your constructor. However, I thi... | <p>I have the enviable situation of working for the guy who wrote <code>+alloc</code> back in 1991, and I happened to ask him a very similar question a few months ago. The addition of <code>+alloc</code> was in order to provide <code>+allocWithZone:</code>, which was in order to add memory pools in NeXTSTEP 2.0 where m... |
linq error <p>I am working on a mobile.net project.
I am trying to make a list of restaurants which is displayed in a drop down list...whn d user selects an item he can add it to d list of favorites.
However i am getting an error</p>
<pre><code>Description: An error occurred during the compilation of a resource requir... | <p>You have 2 or more emptyChangingEventArgs declared. It's pretty obvious from the error message.</p>
|
Is there a multilanguage program that will generate emacs-compatible who-calls information? <p>There is, and has been for awhile, the excellent etags program. For many languages it allows one to generate a TAGS file which emacs can use to jump from a call site to the definition. The versions of etags I have seen supp... | <p><a href="http://www.stack.nl/~dimitri/doxygen/" rel="nofollow">Doxygen</a> makes call graphs, and I suppose you could take the data used for graphing and make use of it in Emacs.</p>
|
RecvFrom() returns packet larger than sender NIC MTU <p>I have proprietary application sending out multicast packet to the network. It is running on the linux with NIC MTU 1500.</p>
<p>And then I write a simple java program to using MulticastSocket class to receive message. I found it is DatagramPacket size is ~7900. ... | <p>I would guess that you are testing on the machine where the proprietary service is running. In that case, the linux box will let them communicate over the local loopback device, which has a MTU of 64k.</p>
|
Why does NSAppleScript's compileAndReturnError always succeed? <p>Given that <code>NSAppleScript</code> objects are always supposed to run on the main thread, I created a small "proxy" object to use:</p>
<pre><code>@interface AppleScriptProxy : NSObject {
NSAppleScript *m_script;
NSDictionary *m_errorDict;
}
... | <p>Try it in Script Editor. âfooâ compiles just fine; it just doesn't run.</p>
<p>Try â<code>*</code>â as your compile-test script.</p>
<p>BTW, running a script can raise an error, too (as you can see in Script Editor). Make sure you handle that.</p>
|
Tree parsers for compilers written in C++ <p>I'd like to find a tree parser generator to help me transform ASTs for a compiler written in C++.</p>
<p>After some quick research I found out about ANTLR (which can be targeted to work with C but not C++). I also found a website that warns against using ANTLR with C++: <a... | <p>There are <a href="http://www.google.com/search?client=safari&rls=en-us&q=C%2B%2B%2BAST%2Btree%2Btransformations&ie=UTF-8&oe=UTF-8" rel="nofollow">plenty of other parser generators</a>, but I have to say that after being unhappy with ANTLR for years, the newest version seems pretty good.</p>
|
SSIS how to write to log table without being rolled back by a transaction failure? <p>When processing a batch of records, if any of them fail business rule validations the entire set of inserted data is rolled back for data integrity. During this process I need to log such errors to a table in the database - which shou... | <p>It looks like I can set containers to Not Supported...
<a href="http://blogs.conchango.com/jamiethomson/archive/2004/12/14/SSIS_3A00_-Package-transactions.aspx" rel="nofollow">http://blogs.conchango.com/jamiethomson/archive/2004/12/14/SSIS_3A00_-Package-transactions.aspx</a></p>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.