instruction
stringlengths
21
27.8k
chosen
stringlengths
18
28.2k
rejected
stringlengths
18
33.6k
__index_level_0__
int64
0
50k
<p>Do you use ILMerge? Do you use ILMerge to merge multiple assemblies to ease deployment of dll's? Have you found problems with deployment/versioning in production after ILMerging assemblies together?</p> <p>I'm looking for some advice in regards to using ILMerge to reduce deployment friction, if that is even possibl...
<p>I use ILMerge for almost all of my different applications. I have it integrated right into the release build process so what I end up with is one exe per application with no extra dll's. </p> <p>You can't ILMerge any C++ assemblies that have native code. You also can't ILMerge any assemblies that contain XAML for...
<p>It seems to me like the #1 ILMerge Best Practice is Don't Use ILMerge. Instead, use <a href="http://www.red-gate.com/products/smartassembly/index.htm" rel="nofollow noreferrer">SmartAssembly</a>. One reason for this is that the #2 ILMerge Best Practice is to always run PEVerify after you do an ILMerge, because ILM...
3,080
<p>For example, will SQL Server warn you or does it just die?</p>
<p>SQL Server 2005 will throw the following error when you overflow the IDENTITY column. </p> <pre><code>Server: Msg 8115, Level 16, State 1, Line 1 Arithmetic overflow error converting IDENTITY to data type int. Arithmetic overflow occurred. </code></pre> <p>Your identity column need not be constrained to an INT an...
<p>It would likely do both. </p>
49,759
<p>I have started printing with PETG so I can create objects that won't deform if I leave them in my car.</p> <p>My first prints look good, but have strings of material coming off the print in places.</p> <p>What should I try to prevent that? </p> <p>I haven't had this problem with PLA. </p>
<p>I've had similar experiences switching from PLA to PETG, and haven't gotten it fully figured out yet.</p> <p>From what I know so far, to reduce petg strings:</p> <ul> <li>Increase retraction</li> <li>Lower temperature</li> </ul>
<p>I've had similar experiences switching from PLA to PETG, and haven't gotten it fully figured out yet.</p> <p>From what I know so far, to reduce petg strings:</p> <ul> <li>Increase retraction</li> <li>Lower temperature</li> </ul>
671
<p>Why are flat text files the state of the art for representing source code?</p> <p>Sure - the preprocessor and compiler need to see a flat file representation of the file, but that's easily created.</p> <p>It seems to me that some form of XML or binary data could represent lots of ideas that are very difficult to t...
<ul> <li>you can diff them</li> <li>you can merge them</li> <li>anyone can edit them</li> <li>they are simple and easy to deal with</li> <li>they are universally accessible to thousands of tools</li> </ul>
<p>The code of your program define the structure that would be created with xml or the binary format. Your programming language is a more direct representation of your program's structure than an XML or Binary representation would be. Have you ever noticed how Word misbehaves on you as you give structure to your docume...
19,419
<p>I am currently using...</p> <pre><code>select Table_Name, Column_name, data_type, is_Nullable from information_Schema.Columns </code></pre> <p>...to determine information about columns in a given database for the purposes of generating a DataAccess Layer.</p> <p><strong>From where can I retrieve information about...
<p>Here is one way (replace 'keycol' with the column name you are searching for):</p> <pre><code>SELECT K.TABLE_NAME , K.COLUMN_NAME , K.CONSTRAINT_NAME FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS AS C JOIN INFORMATION_SCHEMA.KEY_COLUMN_USAGE AS K ON C.TABLE_NAME = K.TABLE_NAME ...
<p>this query return column with is primary key.</p> <pre><code>SELECT col.COLUMN_NAME , col.DATA_TYPE , col.CHARACTER_MAXIMUM_LENGTH ln , CAST(ISNULL(j.is_primary, 0) AS BIT) is_primary FROM INFORMATION_SCHEMA.COLUMNS col LEFT JOIN ( SELECT K.TABLE_NAME , ...
27,412
<p>In class, we learned about the halting problem, Turing machines, reductions, etc. A lot of classmates are saying these are all abstract and useless concepts, and there's no real point in knowing them (i.e., you can forget them once the course is over and not lose anything).</p> <p>Why is theory useful? Do you ever ...
<p>When I graduated from college, I assumed that I was on par with everyone else: "I have a BS in CS, and so do a lot of other people, and we can all do essentially the same things." I eventually discovered that my assumption was false. I stood out, and my background had a lot to do with it--particularly my degree.<...
<p>I guess it depends on which field you go into. </p>
29,140
<p>My question is, how do I version control the production environment in a good way?</p> <p>This is our current environment:</p> <ul> <li>(Internal server) Development - Version controlled source code</li> <li>(Customer server) Acceptance test environment</li> <li>(Customer server) Staging environment</li> <li>(Cust...
<p>Another way to do things would be to use a build server. Every time you check in code the build server builds and packages up the new build inside the development environment. Then checks in the deployable package with your code.</p> <p>You can then deploy the packaged build to the other environments. This way you ...
<p>Thank you for your answers and suggestions.</p> <p>I see that I need to rethink the way we handle releases to these environments. Having a build server with all the releases ever made could solve a part of the problem. I will get the commit comments on the source code, and much better control of what feature goes i...
33,149
<ol> <li>What's the best delimiter to use when exporting data?</li> <li>What's the best way to work with NULL data if you have an INT field in the table?</li> </ol>
<p>I'm not sure what the asker (nice name, :JPnoui38f) is trying to do. Sql Server management Studio has the ability to dump your data in a number of different ways. You don't have to worry about how to handle nulls or what delimeter to use. The tools take care of that.</p> <p>Here's an <a href="http://www.database...
<ol> <li><p>If you have data with embedded control characters you may want to do a prefix based export using bcp instead of delimited text. The prefix prepends a column with a length indicator and the import reads this rather than looking for the delimiter.</p></li> <li><p>For some reason that I cannot fathom and ...
21,433
<p>In my fieldset I have labels next (side) to my textboxes, but for some reason, they are towards the top and not middle. Here is my CSS for the fieldset:</p> <pre><code>fieldset { clear: both; font-size: 100%; border-color: #000000; border-width: 1px 0 0 0; border-style: solid none none none; padding: 10...
<p>Try adjusting the <strong>line-height</strong> property for the label element. You may need to increase or decrease it.</p>
<p>To me this is the most frustrating thing about css... Zack is right it will probably take some tweaking with the line-height, sometimes <b>lots</b> of tweaking (like 20px). i think that floating the element causes line height to be difficult?? if you want it in the middle of the line you should set vertical-align:...
32,181
<p>How do I "name" a browser window in ROR, such that I can open a page in it later, from another (popup) window (using the target="name" html parameter)</p>
<p>You have to use JavaScript for this:</p> <pre><code>&lt;script type="text/javascript"&gt; window.name = "MyWindow"; &lt;/script&gt; </code></pre> <p>Of course you could easily package this up into a Rails helper method. For example, in <code>app/helpers/application_helper.rb</code> add a new method:</p> <pre><c...
<p>You could try below:</p> <pre><code>var x=window.open("", "myWindow"); var y="&lt;head&gt;&lt;title&gt;my window&lt;/title&gt;&lt;/head&gt;&lt;body&gt;my window&lt;/body&gt;"; x.document.write(y); </code></pre>
5,675
<p>In Delphi 2009 I'm finding that any time I use TThread.CurrentThread in an application, I'll get an error message like the following when the application closes:</p> <pre><code>Exception EAccessViolation in module ntdll.dll at 0003DBBA. Access violation at address 7799DBBA in module 'ntdll.dll'. Write of address 0...
<p>Unfortunately it seems like a bug linked to the call order of the finalization section in the Classes unit: </p> <p><code>DoneThreadSynchronization</code> clears the <code>ThreadLock</code> structure, then<br> <code>FreeExternalThreads</code> wants to destroy the Thread object you just created when calling <code>C...
<p>I think CurrentThread is added in 2009 (or 2007). I have 2006 at home. But are you sure it is a class property?</p>
22,825
<p>I got a Tronxy X5S-400, I assembled it and when I power it on, I see on the screen one of the below images and gets stuck there.</p> <p>Is the firmware broken? If yes, where can I get a <code>configuration.h</code> file?</p> <p>I verified that the two buses between the screen and the mainboard are not loose or inc...
<p>It looked like the firmware wasn't flashed correctly in the factory. What I did was to flash a bootloader using an Arduino compatible board and to flash the Marlin software e.g. according to <a href="https://www.youtube.com/watch?v=3gwWVFtdg-4" rel="nofollow noreferrer">videos from this guy</a>.</p> <p>Next, the me...
<p>If the controller is one of Tronxy's new Chitu boards, you will not have the option of recompiling the firmware, since they are locked down. Apart from checking that the PSU is delivering the correct voltage, your only option may be to request a new main board from the vendor.</p>
1,286
<p>I remember reading about an automation program for windows that would accept a list of commands like this:</p> <pre><code>press the ok button put "hello world" into the text control press the add button </code></pre> <p>etc etc. Can anyone name this program? A thousand thankyous.</p>
<p>Take a look at watin. <a href="http://watin.sourceforge.net/" rel="nofollow noreferrer">http://watin.sourceforge.net/</a> Combined with Microsoft Oslo DSL. You can achieve this easily</p>
<p>Maybe look for a port of AppleScript to Windows? Assuming such a beast does not exist, perhaps something like <a href="http://www.autohotkey.com/" rel="nofollow noreferrer">AutoHotKey</a> or <a href="http://www.autoitscript.com/autoit3/index.shtml" rel="nofollow noreferrer">AutoIt</a> might be close enough?</p>
38,022
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="https://stackoverflow.com/questions/249760/how-to-convert-unix-timestamp-to-datetime-and-vice-versa">How to convert UNIX timestamp to DateTime and vice versa?</a> </p> </blockquote> <p>I've got the following class:</p> <pre><code>[DataContractAt...
<p>Finishing what you posted, AND making it private seemed to work fine for me.</p> <pre><code>[DataContract] public class TestClass { private static readonly DateTime unixEpoch = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc); [IgnoreDataMember] public DateTime MyDateTime { get; set; } [Dat...
<p>What you want is the following:</p> <pre><code>DateTime unixEpoch = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc); DateTime dotnetTime = unixEpoch.AddSeconds(Convert.ToDouble(ticks)); </code></pre> <p>where <code>ticks</code> is the value passed to you by PHP.</p>
31,055
<p>I have two web applications running in the same Tomcat Instance. In one of these applications the user will have the ability to upload files such as images and pdf files. I would like the uploaded files to be available to the second application. </p> <p>Is there a best practice for such a scenario? Or just a pointe...
<p>Cheap, bad answer - have both applications softlink to a shared directory. This has the benefit of being stupid-simple to do but has evil transactional-type issues. Since you say that only one application is changing the data, and the other is read-only you might be able to get away with it, as long as the second ap...
<p>You could shove the files into a shared database... this also lets you store meta data along with them.</p>
24,072
<p>I have seen the official demos on lwjgl.org but I would like to see some more tutorial level examples.</p>
<p>Google "import org.lwjgl" to find lots of examples, as all code that uses LWJGL must contain that string to import parts of the package.</p>
<p>The <a href="http://lwjgl.org/wiki/index.php?title=Main_Page" rel="nofollow">LWJGL wiki</a> contains several examples with explanations. Since most work in LWJGL directly reflects OpenGL (e.g. 'glBegin()'), you could just look up some OpenGL tutorials.</p>
20,919
<p>I want to get virtual path of a web page from a web service. Is there any way to do this?. suppose i have an aspx page like aa, i want to get full path as a url for that page from my web service.</p> <p>Regards, Harsh Suman</p>
<p>What type of web-service? asmx? or wcf (svc)?</p> <p>With asmx, you can use <code>HttpContext.Current</code> to get the current ASP.NET request, so you can get pretty-much anything you can get with ASP.NET; try looking at the <code>.Request</code> property of <code>HttpContext.Current</code>.</p> <p>With wcf, this...
<p>I agree with the post above. You can use the HttpContext.Current.Request object to get at virtual path and request URL.</p> <pre><code>string path = HttpContext.Current.Request.ApplicationPath; </code></pre> <p>or if you want the full URL:</p> <pre><code>string path = HttpContext.Current.Request.Url.OriginalStri...
45,489
<p>I am a self-taught embedded developer. I mostly use AVRs programmed in C and ASM, but I have dabbled with other systems. I am looking to move onto more complex devices like CPLDs and FPGAs, but I have no idea where to start. So my one and a half questions are:</p> <ol> <li>Do you prefer VHDL or Verilog and why?</li...
<p>Buy a cheap starter kit from Xilinx or Altera (the two big FPGA players). A Xilinx Spartan3 starter kit is $200.</p> <p>I personally prefer VHDL. It is strongly typed and has more advanced features than Verilog. VHDL is more popular in Europe and Verilog is dominating in the US. </p> <p>Buy a book (e.g. Peter Ashe...
<p>Before plunging into Verilog/VHDL or buying an FPGA dev kit I'd recommend taking an introductory class on digital design. There are good online <a href="http://ocw.mit.edu/OcwWeb/web/home/home/index.htm" rel="nofollow noreferrer">OpenCourseWare MIT </a>classes. </p> <p>Good luck.</p>
21,388
<p>The GetVersions() call to the Versions.asmx web service in SharePoint 2003 returns a localised date format, with no way of determining what the format is. It's the site regional setting of date format, but I can't find a way to get even that out of SharePoint 2003. Locally, it looks like SPRegionalSettings can be us...
<p>Sadly, it isn't available. However, you can specify a query option to specify that you want the values returned in UTC:</p> <p><a href="http://www.sharepointblogs.com/pm4everyone/archive/2006/10/03/sharepoint-2003-querying-with-gmt-datetime.aspx" rel="nofollow noreferrer"><a href="http://www.sharepointblogs.com/pm4...
<p>Sadly, it isn't available. However, you can specify a query option to specify that you want the values returned in UTC:</p> <p><a href="http://www.sharepointblogs.com/pm4everyone/archive/2006/10/03/sharepoint-2003-querying-with-gmt-datetime.aspx" rel="nofollow noreferrer"><a href="http://www.sharepointblogs.com/pm4...
17,728
<p>Does anyone know how I can get a list of products belonging to a specific category from within a view file in <a href="http://www.magentocommerce.com/" rel="noreferrer">Magento</a>?</p>
<p>You can use magento object to filter.</p> <p>Example:</p> <pre><code>$categoryId = 123; // a category id that you can get from admin $category = Mage::getModel('catalog/category')-&gt;load($categoryId); $products = Mage::getModel('catalog/product') -&gt;getCollection() -&gt;addCategoryFilter($category) ...
<p>You should always avoid putting code like this into a view, it's very bad practice. You can also run into issues as views can be cached, leading to unexpected behaviour.</p> <p>you should override the block you are using, placing code there. you can then call any new methods inside your view files.</p> <p>for exa...
34,356
<p>Any ideas how i can best drive a USB POS printer from c#. POS printers are usually serial, TCP/IP or USB based. I know how to accomplish serial and TCP/IP but have no idea about communications through USB in C#. I know that there is a layer available from Microsoft called POS.NET, but I want to try and avoid using t...
<p>You should really consider using POS for .NET and OPOS or .NET service objects (Epson, for example provides both). POS for .NET conforms to the UnifiedPOS industry standard for interfacing with these devices.</p>
<p>There is a C# wrapper for Win32 USP api's from the icsharpcode guys <a href="http://www.icsharpcode.net/opensource/sharpusblib/" rel="nofollow noreferrer">here</a>, and I've seen at least <a href="http://weblogs.asp.net/israelio/archive/2005/08/15/422637.aspx" rel="nofollow noreferrer">one</a> other reference to USB...
22,704
<p>How do I get a patch from a commit in order to send it to another developer? And how do I best avoid a merge conflict with this patch when merging our trees at a later date?</p> <p>If you know how please explain how to do this in your VCS of choice such as subversion, git, Mercurial, bzr or etc.</p>
<p>In <a href="http://git.or.cz/" rel="noreferrer">git</a> you can pipe the output of <a href="http://git-scm.com/docs/git-diff" rel="noreferrer"><code>git-diff</code></a> between two commits like this:</p> <pre><code>git diff fa1afe1 deadbeef &gt; patch.diff </code></pre> <p>Send the <code>patch.diff</code> to the d...
<p>In SVN you can simply make your changes then before commiting, pipe the output of the svn diff to a file as such</p> <pre><code>svn diff &gt; mypatch.diff </code></pre> <p>you can then revert your changes and apply the patch at a later date using</p> <pre><code>patch -p0 -i mypatch.diff </code></pre> <p>As alway...
37,496
<p>I have an application which is supposed to work on both windows and Mac and is localized in Portuguese, Spanish and German. I have an ini file from where the localized strings are read from. But the ini file doesn't work with same encoding for the files on both platforms. For Windows I have to have the file in ANSI ...
<p>(1) There is no such thing as <em>the</em> ANSI format. That's an unfortunate term for what on Windows means "the local codepage". In particular, this means that in Europe the interpretation of bytes 128-255 as "ANSI format" will differ between countries. So, I am strongly inclined to argue that it won't even work o...
<p><a href="http://www.gnu.org/software/gettext/" rel="nofollow noreferrer">gettext</a> is a widely used framework for translation of applications, websites, etc.</p>
20,173
<p>I have a core dump file from a process that has probably a file descriptor leak (it opens files and sockets but apparently sometimes forgets to close some of them). Is there a way to find out which files and sockets the process had opened before crashing? I can't easily reproduce the crash, so analyzing the core fil...
<p>If you have a core file and you have compiled the program with debugging options (-g), you can see where the core was dumped:</p> <pre><code>$ gcc -g -o something something.c $ ./something Segmentation fault (core dumped) $ gdb something core </code></pre> <p>You can use this to do some post-morten debugging. A few ...
<p>Another way to find out what files a process has opened - again, only during runtime - is looking into /proc/PID/fd/ , which contains symlinks to open files.</p>
8,297
<p>I run Jetty6 yet gladly place Apache in the front if needs be.</p> <p>I would like to have two webserver instances running on the same machine on different ports. I would like the instance on port 80 to redirect the second public domain name to the second webserver on port 8080.</p> <p>This should not be visible t...
<p><a href="http://nginx.net/" rel="nofollow noreferrer">nginx</a> setup as a proxy is a common method for doing this. It has a good reputation and I personally know of several high traffic sites using it with good results. </p> <p>The <a href="http://wiki.codemongers.com/Main" rel="nofollow noreferrer">twiki</a> has ...
<p>If I understand your question correctly, you need to enable mod_proxy in Apache, then use this line on the web server running on port 80.</p> <p>ProxyPassReverse / <a href="http://localhost:8080/" rel="nofollow noreferrer">http://localhost:8080/</a></p> <p>This will reverse proxy all requests to port 80 onto...
33,126
<p>How do I force Postgres to use an index when it would otherwise insist on doing a sequential scan?</p>
<p>Assuming you're asking about the common "index hinting" feature found in many databases, PostgreSQL doesn't provide such a feature. This was a conscious decision made by the PostgreSQL team. A good overview of why and what you can do instead can be found <a href="http://blog.2ndquadrant.com/hinting_at_postgresql/" r...
<p>Apparently there are cases where Postgre can be hinted to using an index by repeating a similar condition twice.</p> <p>The specific case I observed was using PostGIS <code>gin</code> index and the <a href="https://postgis.net/docs/ST_Within.html" rel="nofollow noreferrer">ST_Within</a> predicate like this:</p> <pre...
39,913
<p>i want to have some shared code (code library, controls, utilities, helper classes, etc) in Visual Studio. i do not mean shared assemblies, i mean shared code (i.e. i want to ship one assembly with my application, the executable assembly).</p> <p>The technique in other development environments way is to have the co...
<p>I could propose two solutions:</p> <ol> <li>Visual Studio allows you to add a link to a file. Choose "Add Existing Item", pick your file and then click the arrow next to the "Add" button. A popup will display and you should choose "Add as link" from there. Now you can store your common code in one location (folder)...
<p>We use ClickOnce deployment, which has been very reliable. With ClickOnce, there is <em>conceptually</em> a single object, the application, although many files (including DLLS) are downloaded, although hidden to the user. Shared code is then dealt with through shared projects.</p> <p>But if you actually physically ...
32,814
<p>The application uses Oracle DataAccess ver. 1.1. , VS 2008, .Net Framework 3.5 w/SP1</p> <pre><code>OracleConnection connection = new OracleConnection(ConnectionStringLogon); connection.Open(); OracleParameter selectParam = new OracleParameter(":applicationName", OracleDbType.Varchar2, 256); selectParam.Value = a...
<p>if you're using apache you may want to take a look at <a href="http://httpd.apache.org/docs/2.0/programs/ab.html" rel="noreferrer">apache ab</a></p>
<p>We use Loadrunner to do bandwidth and traffic simulation in our App. Loadrunner is can start agents on various machines and you can simulate one machine as running on dialup modem v/s another on DSL v/s another on Cable internet. We also use Loadrunner to simulate various kinds of traffic conditions from 10 user run...
18,785
<p>What is the best C++ IDE for a *nix envirnoment? I have heard the C/C++ module of Eclipse is decent as well as Notepad++ but beyond these two I have no real idea. Any thoughts or comments?</p>
<p>On Ubuntu, some the IDEs that are available in the repositories are:</p> <ul> <li><a href="http://www.kdevelop.org/" rel="noreferrer">Kdevelop</a></li> <li><a href="http://geany.uvena.de/" rel="noreferrer">Geany</a></li> <li><a href="http://anjuta.sf.net/" rel="noreferrer">Anjuta</a></li> </ul> <p>There is also: ...
<p>I can't really vouch for the Eclipse module, but that might be attributed to the fact that I'm on Windows and have nearly no idea what I'm doing. </p> <p>Can't go wrong with your favorite text editor though.</p>
10,456
<p>When developing Java applications, I often override Object methods (usually equals and hashCode). I would like some way to systematically check that I'm adhering to the contract for Object methods for every one of my classes. For example, I want tests that assert that for equal objects, the hash code is also equal...
<pre> public static void checkObjectIdentity(Object a1, Object a2, Object b1) { assertEquals(a1, a2); assertEquals(a2, a1); assertNotSame(a1, a2); assertEquals(a1.hashCode(), a2.hashCode()); assertFalse(a1.equals(b1)); assertFalse(a2.equals(b1)); assertFalse(b...
<p>I think VonC's on the right track, but I would even settle for something less sophisticated, such as a parameterized test that takes in the .class object (for which the Object methods are being tested), followed by a variable number of constructor args. Then, you'd have to use reflection to find the constructor tha...
23,056
<p>I have a question about how to do something "The Rails Way". With an application that has a public facing side and an admin interface what is the general consensus in the Rails community on how to do it?</p> <p>Namespaces, subdomains or forego them altogether?</p>
<p>There's no real "Rails way" for admin interfaces, actually - you can find every possible solution in a number of applications. DHH has implied that he prefers namespaces (with HTTP Basic authentication), but that has remained a simple implication and not one of the official Rails Opinions.</p> <p>That said, I've fo...
<p>Thanks to everyone that answered my question. Looks like the consensus is to use namespaces if you want to as there is no DHH sponsored Rails Way approach. :)</p> <p>Again, thanks all!</p>
14,499
<p>I want to build my own custom log4j (network) adapter to solve my problem <a href="https://stackoverflow.com/questions/29505/deserialize-in-a-different-language">that I posted here.</a></p> <p>I have looked at the documentation on the log4j and I cant see where/if the developers go into how to do this.</p> <p>Can ...
<p><a href="http://www.javaworld.com/javaworld/jw-12-2004/jw-1220-toolbox.html" rel="nofollow noreferrer">Write custom appenders for log4j</a></p>
<p>May I suggest that you leverage the existing SyslogAppender?</p>
6,933
<p>Huge files take forever to load and work with in vim, due to syntax-highlighting.</p> <p>I'm looking for a way to limit size of highlighted files, such that files larger than (say) 10MB will be colorless.</p>
<p>Adding the following line to _vimrc does the trick, with a bonus: it handles gzipped files, too (which is a common case with huge files):</p> <pre><code>autocmd BufWinEnter * if line2byte(line("$") + 1) &gt; 1000000 | syntax clear | endif </code></pre>
<p>vim -c 'syntax off' filename.ext</p>
21,481
<p>Working to get DateTimes for any time zone. I'm using DateTimeOffset, and a string, and an XmlElement attribute. When I do, I get the following error:</p> <blockquote> <p>[InvalidOperationException: 'dateTime' is an invalid value for the XmlElementAttribute.DataType property. dateTime cannot be converted t...
<p>Take a look at this StackOverflow question about serializing dates and UTC:</p> <p><a href="https://stackoverflow.com/questions/65164/best-practices-for-datetime-serialization-in-net-framework-35sql-server-2008">Best practices for DateTime serialization in .Net framework 3.5/SQL Server 2008</a></p> <p>No need to c...
<p>The datatype of the property <code>creationTimeX</code> is string while the XmlSerialization datatype is <code>DateTime</code>. That's why you are getting that exception.</p> <p>You can fix this by changing the datatype to <code>DateTime</code>.</p> <p>Also for your issue of the current time for any timezone, you w...
39,565
<p>When indenting java code with annotations, vim insists on indenting like this:</p> <pre><code>@Test public void ... </code></pre> <p>I want the annotation to be in the same column as the method definition but I can't seem to find a way to tell vim to do that, except maybe using an indent expression but I'm not...
<p>Edit: I cannot delete my own answer because it has already been accepted, but <a href="https://stackoverflow.com/a/4414015/2844">@pydave's answer</a> seems to be the better (more robust) solution. <hr> You should probably be using the indentation file for the java FileType (instead of using cindent) by setting <code...
<p>I found pydave's suggestion <em>almost</em> what I wanted, but I wanted this:</p> <pre><code>@Override public void ... </code></pre> <p><strong>and</strong> this:</p> <pre><code>@Override public void ... </code></pre> <p>so I replaced the regex (as per pydave's, place in <code>~/.vim/after/indent/java.vim</code>...
24,530
<p>I recently turned on Windows Firewall logging on my computer and started tracking incoming and outgoing connections. Something curious about the logfiles is that I have noticed numerous UDP packets (in fact, it constitutes basically all of my incoming traffic) that don't have my host as destination or source showing...
<p>The packets addressed to IPs starting with 239 and 224 are <a href="http://en.wikipedia.org/wiki/Multicast" rel="noreferrer">multicast packets</a>. This is a way to address traffic to a group of computers without broadcasting it to an entire network. It is used by various legitimate protocols.</p> <p>224.0.0.252 ...
<p>Hard to say without analyzing the log data, but they could be broadcast packets on the segment, in which case you're system would listen to them. This is possible in IPv4 and IPv6.</p> <p>Your system should not be forwarding them unless it's set up to route, but it can certainly be listening to packets all the time...
23,639
<p>I have a working TYPO3 extension. It is attached <a href="http://wiki.orbeon.com/forms/doc/developer-guide/form-runner-typo3-extension" rel="nofollow noreferrer">this wiki page</a>. How can I change the code of this extension so it is of the USER_INT type? I.e. I don't want TYPO3 to cache the output of this plugin, ...
<p>To disable caching for your extension go to your piX/class.tx_XXX_piX.php file and remove the following line (below your class declaration):</p> <pre><code>var $pi_checkCHash = true; </code></pre> <p>You also need to add the following line in the main method (below $this->pi_loadLL();):</p> <pre><code>$this-&gt;p...
<p>When you have created your extension with Kickstarter you also have to go to the file [yourextension]/ext_localconf.php and change this line</p> <pre><code>t3lib_extMgm::addPItoST43($_EXTKEY,'piX/class.tx_yourextension_piX.php','_piX','list_type',0); </code></pre> <p>to this:</p> <pre><code>t3lib_extMgm::addPIto...
37,396
<p>I'm receiving a recovery feed from an exchange for recovering data missed from their primary feed.</p> <p>The exchange <strong>strongly</strong> recommends listening to the recovery feed only when data is needed, and leaving the multicast once I have recovered the data I need.</p> <p>My question is, if I am using ...
<p>It's likely <strong>not</strong> harming your application so much as harming your machine - since the nic is still configured into the multicast group, it's still listening to those messages and passing them up, before your software ignores them and they get discarded. That's a lot of extra work that your network st...
<p>An addition to <a href="https://stackoverflow.com/users/6306/muz">muz's</a> comment...</p> <p>It's unlikely that this will make any difference to your system, but it's worth being aware that there is an overhead associated with maintaining a multicast membership (assuming that you're using IGMP - which is probably ...
9,888
<p>Portfolio A → Fund 1</p> <p>Portfolio A → Fund 2</p> <p>Portfolio A → Fund 3</p> <p>I couldn't frame my sentence without not using is/has. But between 1 &amp; 2,</p> <p>1) has a:</p> <pre><code>class PortfolioA { List&lt;Fund&gt; obj; } </code></pre> <p>2) is a:</p> <pre><code>class PortfolioA : List&lt;F...
<p>I vote with the other folks who say HAS-A is better in this case. You ask in a comment:</p> <blockquote> <p>when I say that a Portfolio is just a collection of funds, with a few attributes of its own like TotalPortfolio etc, does that fundamentally not become an "is-a"?</p> </blockquote> <p>I don't thin...
<p><strong>IS-A relation ship</strong> represents inheritances and <strong>HAS-A relation ship</strong> represents composition. For above mentioned scenario we prefer composition as PortfolioA has a List and it is not the List type. Inheritances use when Portfolio A is a type of List but here it is not. Hence for this ...
32,969
<p>I've been attempting to learn C in my spare time, and other languages (C#, Java, etc.) have the same concept (and often the same operators)...</p> <p>At a core level, what does bit-shifting (<code>&lt;&lt;</code>, <code>&gt;&gt;</code>, <code>&gt;&gt;&gt;</code>) do, what problems can it help solve, and what gotchas...
<p>The bit shifting operators do exactly what their name implies. They shift bits. Here's a brief (or not-so-brief) introduction to the different shift operators.</p> <h2>The Operators</h2> <ul> <li><code>&gt;&gt;</code> is the arithmetic (or signed) right shift operator.</li> <li><code>&gt;&gt;&gt;</code> is the lo...
<p>Be aware of that only 32 bit version of PHP is available on the Windows platform.</p> <p>Then if you for instance shift &lt;&lt; or >> more than by 31 bits, results are unexpectable. Usually the original number instead of zeros will be returned, and it can be a really tricky bug.</p> <p>Of course if you use 64 bit...
17,105
<p>How do I Unit Test a MVC redirection?</p> <pre><code>public ActionResult Create(Product product) { _productTask.Save(product); return RedirectToAction("Success"); } public ActionResult Success() { return View(); } </code></pre> <p>Is <a href="http://www.ayende.com/Blog/archive/2007/12/13/Dont-lik...
<pre><code>[TestFixture] public class RedirectTester { [Test] public void Should_redirect_to_success_action() { var controller = new RedirectController(); var result = controller.Index() as RedirectToRouteResult; Assert.That(result, Is.Not.Null); Assert.That(result.Values["ac...
<p>You can assert on the ActionResult that is returned, you'll need to cast it to the appropriate type but it does allow you to use state-based testing. A search on the Web should find some useful links, here's <a href="http://sebastienlachance.com/2008/05/06/testing-controllers-in-aspnet-mvc-aka-actionresult/" rel="no...
8,286
<p>We're experimenting with various ways to throttle user actions in a <strong>given time period</strong>:</p> <ul> <li>Limit question/answer posts</li> <li>Limit edits</li> <li>Limit feed retrievals</li> </ul> <p>For the time being, we're using the Cache to simply insert a record of user activity - if that record ex...
<p>Here's a generic version of what we've been using on Stack Overflow for the past year:</p> <pre><code>/// &lt;summary&gt; /// Decorates any MVC route that needs to have client requests limited by time. /// &lt;/summary&gt; /// &lt;remarks&gt; /// Uses the current System.Web.Caching.Cache to store each client reques...
<p>Since the highly voted answers to this question are too old, I am sharing the latest solution which worked for me.</p> <p>I tried using the Dynamic IP restrictions as given in an <a href="https://stackoverflow.com/a/584689/3085520">answer</a> on this page but when I tried to use that extension, I found that this ext...
5,412
<p>As a followup to my <a href="https://stackoverflow.com/questions/227143/java-what-is-javaawtcomponentgetname-and-setname-used-for">question about the java.awt.Component.getName() property</a>, I'm wondering if there is a way of squirreling an arbitrary object somewhere in a Component, similar to the <a href="http://...
<p>I generally create a hash and put (component, cookie) whenever I add a component to the screen. When you need your cookie object back (in an event perhaps), the event always gets a copy of the component, and then you are just a get(component) away from your cookie.</p> <p>In some extreme conditions, I've subclasse...
<p>Yeah, you could use the get/setName to set some kind of identifier, then use that identifier for mapping to your help. the JavaHelp CSH stuff works kind of like that, except that i believe that is putting the component itself into a map?</p>
28,119
<p>I'm trying to add an SVN repository to Eclipse. </p> <p>I've installed <a href="http://subclipse.tigris.org/" rel="noreferrer">Subclipse</a>, and it seems to be working fine. But, when I try to "add a new SVN repository", I input this, for example:</p> <p><em><a href="http://svn.python.org/projects/peps/trunk" rel...
<p>This is a dead topic, but the solution is to install a client adapter along with Subclipse.</p> <p>Take a look at <a href="http://subclipse.tigris.org/wiki/PluginFAQ#head-da671f9d3dd97d874248445af428545727a8271a" rel="noreferrer">this</a>, and install SVN Client Adapter, SVNKit Adapter, and SVNKit Library.</p> <p>...
<p>I saw the same error and solved by switching off the proxy settings in TortoiseSVN that I normally need for commits to the company servers. I installed Subclipse to back up my own non-prime-time stuff to a local repository (using VisualSVN). I use Eclipse Galileo 3.3 and Subclipse 1.6.12.</p>
11,105
<p>I'm looking for tutorials or walkthroughs for converting DTS packages into the new SSIS 2005. Any one knows.</p>
<p><a href="http://msdn.microsoft.com/en-us/library/cc768544.aspx" rel="noreferrer">Migrating DTS Packages to Integration Services</a></p> <p>SQL Server Integration Services provides a robust way to process millions of rows of data. The platform is highly extensible and performs much faster than the previous DTS platf...
<p>within solution explorer there is a menu option to import DTS packages. This should do all the conversion for you. Having said that i've only ever tried it on simple packages</p>
32,281
<p>I`m using Delphi 2009 and want to operate some XML data. I heard that nativeXML is one of the most convenient ways to do it. so how can I install this library?</p>
<p>NativeXML doesn't claim to support Delphi 2009 just yet. [Edit: Apparently there is a 2009 beta available to paying customers.] The trial version does not, so it cannot work with Delphi 2009 until that version of Delphi is officially supported.</p> <p>That said, using XML in Delphi for most purposes doesn't requir...
<p>Based on their <a href="http://www.simdesign.nl/xml.html" rel="nofollow noreferrer">web site</a>, it sounds like you just download the .dcu file, put it in a convenient directory, and add that directory to your type library path (tools->options->library path).</p> <p>After that, just add the unit to your uses claus...
39,773
<p>My servlet application includes a number of library .jars, some of which contain embedded log4j.xml or log4j.properties files. I'd like to ensure that log4j finds my log4j.xml first! I've tried searching for some specification of the priorities of the various classpath elements in a servlet (e.g. does WEB-INF/classe...
<p>As far as I understand the resource selection from the classpath is non-deterministic (from the point of view of the app developer). Even if the same file is loaded consistently the behaviour could change: 1. When you upgrade the version of your current container. 2. If you switch containers.</p> <p>The simplest ...
<p>You need to have log4j.properties in your CLASSPATH. The best place is under WEB-INF/classes.</p> <p>You also have to make sure that you use your version of log4j.jar. So, put it in WEB-INF/lib, just to make sure you are not using one from tomcat folders, since it may cause strange classloading issues.</p>
33,185
<p>Trying to debug an issue with a server and my only log file is a 20GB log file (with no timestamps even! Why do people use <code>System.out.println()</code> as logging? In production?!)</p> <p>Using grep, I've found an area of the file that I'd like to take a look at, line 347340107.</p> <p>Other than doing someth...
<p>I found two other <a href="http://www.unix.com/unix-dummies-questions-answers/21027-how-do-you-specific-lines-file.html" rel="noreferrer">solutions</a> if you know the line number but nothing else (no grep possible):</p> <p>Assuming you need lines 20 to 40,</p> <pre><code>sed -n '20,40p;41q' file_name </code></pre> ...
<p>You could try this command: </p> <pre><code>egrep -n "*" &lt;filename&gt; | egrep "&lt;line number&gt;" </code></pre>
23,238
<p>Hi were can I find training videos for MySQL ? </p>
<p>In youtube you find somethings like mysql install: <a href="http://www.youtube.com/watch?v=KQcFP3GcQ0s" rel="nofollow noreferrer">http://www.youtube.com/watch?v=KQcFP3GcQ0s</a></p> <p>mysql trainning: <a href="http://www.youtube.com/watch?v=BHq-bORKncA" rel="nofollow noreferrer">http://www.youtube.com/watch?v=BHq-...
<p>And don't forget: <a href="http://dev.mysql.com/" rel="nofollow noreferrer">http://dev.mysql.com/</a></p> <p>This is a good resource to back up anything you find in any videos. I can't recommend any videos as I have no experience with them, sorry. </p>
12,606
<p>I'm working with the PieChart and PieSeries components in Flex, and have ran into an issue. When the labelPosition property of a PieSeries is set to 'inside' and there is only one slice in the pie, the label doesn't get displayed.</p> <p>Looking at the docs, I'm guessing its some quirk related to when inside labels...
<p>All I can do is point out <a href="http://bugs.adobe.com/jira/browse/FLEXDMV-1569" rel="nofollow noreferrer">this bug report</a>, which looks to be what you've come across.</p> <p>I'm afraid I can't get the suggested patch to work though, maybe you'll have better luck.</p>
<p>The Flex charts are designed to be drawn on via the CartesianDataCanvas.</p> <p>See "Drawing on chart controls" in <em>Flex Data Visualization Developer's Guide / Flex Charting Components / Using Events and Effects in Charts</em></p> <p>Cheers</p>
47,152
<p>I'm trying to pick a good CMS that isn't a portal. All of my research as lead me to believe SilverStipe is the best option. I'd like some opinions/impressions.</p> <p>Thanks for any thoughts you have.</p> <p>edit: I've decided to try it out. I'll post my own answer after I've had some time with it. It seems li...
<p>I just stumbled upon Silverstripe / Sapphire a week ago or so (now is the 3rd November 2008) and I was amazed. This seems to be an underestimated piece of software. I'm not such a pro that I could say it for sure but I believe their code is very solid, clean and intelligent. They just got and award for the most prom...
<p>There is also a book on Silverstripe out now - at least a German version, English version anounced for release end of August</p>
30,994
<p>Is there any simple way of creating tappered thread in OpenSCAD? I need something like 10 mm in diameter at the end, 9 at the top and the height of 10 mm.</p>
<p>I mostly use a tooth brush for that kind of problem</p>
<p>If you are able to remove the gear, as I suspect you can, a useful tool is the file card. It resembles a flat hair brush but the bristles are short wire, very stiff. In traditional use, it removes metal shavings from conventional metal files. It will easily remove plastic from between the gear teeth. If you are unab...
323
<p>I've inherited a large VB6 app at my current workplace. I'm kinda learning VB6 on the job and there are a number of problems I'm having. The major issue at the moment is I can't figure out how to check if a key exists in a Collection object. Can anyone help?</p>
<p>@Mark Biek Your keyExists closely matches my standard Exists() function. To make the class more useful for COM-exposed collections and checking for numeric indexes, I'd recommend changing sKey and myCollection to not be typed. If the function is going to be used with a collection of objects, 'set' is required (on t...
<p>While looking for a function like this i designed it as following. This should work with objects and non-objects without assigning new variables.</p> <pre><code>Public Function Exists(ByRef Col As Collection, ByVal Key) As Boolean On Error GoTo KeyError If Not Col(Key) Is Nothing Then Exists = True ...
6,188
<p>Does IPsec in Windows XP Sp3 support AES-256 encryption?</p> <p><strong>Update:</strong></p> <ol> <li>Windows IPsec FAQ says that it's not supported in Windows XP, but maybe they changed it in Service Pack 3?<br> http://www.microsoft.com/technet/network/ipsec/ipsecfaq.mspx<br> Question: <em>Is Advanced Encryptio...
<p>You may well be starving the stack. It is pretty easy to drain in a high open/close transactions per second environment e.g. webserver serving lots of unpooled requests. </p> <p>This is exhacerbated by the default TIME-WAIT delay - the amount of time that a socket has to be closed before being recycled defaults t...
<p>I guess the port number comment from RichS is correct.</p> <p>Other than that, the TCP/IP stack is just a module in your operating system and, as such, can have bugs that might allow an application to kill it. It wouldn't be the first driver to be killed by a program.</p> <p>(A tip to the hat towards Andrew Tanenb...
16,156
<p>Here's the situation: I have a label's text set, immediately followed by a response.redirect() call as follows (this is just an example, but I believe it describes my situation accurately):</p> <p>aspx:</p> <pre><code>&lt;asp:Label runat="server" Text="default text" /&gt; </code></pre> <p>Code-behind (code called...
<p>A <code>Response.Redirect</code> call will ask the user's browser to load the page specified in the URL you give it. Because this is a new request for your page the page utilises the text which is contained in your markup (as I assume that the label text is being set inside a button handler or similar).</p> <p>If ...
<p>So, if I may answer my own question (according to the FAQ, that's encouraged), the short answer is, you don't persist view state through redirects. View state is for postbacks, not redirects.</p> <p>Bonus: <a href="http://msdn.microsoft.com/en-us/library/ms972976.aspx#viewstate_topic10" rel="nofollow noreferrer">Ev...
12,941
<p>The following snippet of C# code:</p> <pre><code> int i = 1; string result = String.Format("{0},{1},{2}", i++, i++, i++); Console.WriteLine(result); </code></pre> <p>writes out: 1,2,3</p> <p>Before I tried this in the compiler I was expecting the assignments to take place and then the evaluations, so my expe...
<p>The <strong>order of evaluation</strong> of arguments is strictly left-to-right in C#. When you evaluate the expression <code>i++</code>, what happens is the value of <code>i</code> is calculated and pushed, then the value of <code>i</code> is incremented.</p> <p>The ++ operator on System.Int32 is effectively a fu...
<p>The arguments of a function are evaluated <a href="http://msdn.microsoft.com/en-us/library/aa691335.aspx" rel="nofollow noreferrer">left-to-right in C#</a>. This is not the case in C/C++, where the standard says the order of evaluation is undefined.</p>
19,926
<p>I'm writing an interpreter for an experimental language. Three of the main constructs of the language are definitions, statements, and expressions. Definitions can contain statements and expressions, statements can contain definitions and expressions, and one kind of expression can contain statements. I represent al...
<p>Recursive definitions need to appear in the same file. If you want to separate definitions, statements, and expressions into separate modules, you can do so using <a href="http://caml.inria.fr/pub/docs/manual-ocaml/manual021.html#htoc100" rel="noreferrer">recursive modules</a>, but they will still need to appear in ...
<p>Another solution often used is to abstract the types in the interfaces. Since the types are abstract in the interfaces, these interfaces are not recursively dependent. In the implementations, you can specify the types, and since the implementations depend only on the interfaces, they are not recursive either.</p> <...
5,691
<p>Our windows deliverable has different sets of config files and binary assets for different customers. Right now the configuring is done by hand before packaging and its error prone. What do you think of using branches for each customer, and having the package build/script automerge the customer's branch with trunk...
<p>I suppose it depends on how many things have to change. For config files, I like to keep a single file under source control and use a build script to set the environment-specific (or in your case client-specific) items.</p> <p><a href="http://automaticchainsaw.blogspot.com/2008/02/automate-config-changes-for-differ...
<p>You don't mention which language, but you might consider doing <a href="http://msdn.microsoft.com/en-us/library/x435tkbk(VS.80).aspx" rel="nofollow noreferrer">conditional compilation</a>:</p> <pre><code>#If FirstCustomer Then ' &lt;code specific to the FirstCustomer version&gt;. #ElseIf SecondCustomer Then '...
35,594
<p>This would be a question for anyone who has code in the App_Code folder and uses a hardware load balancer. Its true the hardware load balancer could be set to sticky sessions to solve the issue, but in a perfect world, I would like the feature turned off.</p> <p>When a file in the App_Code folder, and the site is n...
<p>Do you have the &lt;machinekey&gt; node on both servers set to the same value?</p> <p>You can override the machine.config file in web.config to set this. This needs to match otherwise you can get strange situations like this.</p>
<p>If it's a hardware load balancer, you shouldn't have an issue, because all that is known there is the request URL, in which the server would compile the requested page and serve it.</p> <p>the only issue i can think of that you might have is with session and view state.</p>
7,355
<p>We have a large (about 580,000 loc) application which in Delphi 2006 builds (on my machine) in around 20 seconds. When you have build times in seconds, you tend to use the compiler as a tool. i.e. write a little code, build, write some more code and build some more etc etc As we move some of our stuff over to C#, do...
<p>Visual Studio 2008 SP1 now has background compilation for C# (it's always had it for VB.NET). Back in my VB days, I often used this to find where something was referenced by changing the name and then seeing where the background compiler said there was an error.</p> <p>I never worked on anything quite this large. ...
<p>Well, compiler doesn't have to be that fast to take advantage of it. Some IDEs support incremental compilation on every file save, or either on-the-fly. This works great.</p>
38,798
<p>I'm looking for articles, forum or blog posts dealing with SharePoint and thread safety? I'm quite sure there are some special aspects regarding thread safety that have to be considered when working with the SharePoint object model.</p> <p>Actually I didn't find many information about this, yet.</p> <p>So I'm look...
<p>There are much worse pitfalls in the SharePoint OM than just plain old thread safety. Pay particular attention to working with objects retrieved from properties. You should <em>always</em> keep a pointer to an object while you work on it; example:</p> <pre><code>var list = web.List["MyList"] list.Items[0]["Field1"]...
<p>So after doing some more googling and searching on the web and testing, it seems as if you don't have to care about thread-safety that much when using the MOSS object model because you're always working with non-static and unique instances. </p> <p>Furthermore an exception is thrown when a object e.g. a SPWeb was a...
40,576
<p>I am reading over the K&amp;R book, and am a little stuck.</p> <p>What is wrong with the following?</p> <pre><code>void getInput(int* output) { int c, i; for(i=0; (c = getchar()) != '\n'; i++) output[i] = c; // printf("%c", c) prints the c value as expected output[++i] = '\0'; } </code></pre> <p>Whe...
<blockquote> <p>What is wrong with the following?</p> </blockquote> <pre><code>1. void getInput(int* output) { </code></pre> <p>Why is the input argument an int* when what you want to store in an array of characters? Probably </p> <pre><code>void getInput(char* output) { </code></pre> <p>is better. </p> <p>Also...
<p>a simple way to risk buffer overflow, because output's size is never passed/checked</p>
27,748
<p>I am developing Eclipse plugins, and I need to be able to automate the building and execution of the test suite for each plugin. (Using Junit)</p> <p>Test are working within Eclipse, and I can break the plugins into the actual plugin and a fragment plugin for unit testing as described <a href="http://dev.eclipse.o...
<p>I have just got JUnit testing working as part of the headless build for our RCP application. </p> <p>I found this article - <a href="http://www.eclipse.org/articles/article.php?file=Article-PDEJUnitAntAutomation/index.html" rel="noreferrer">Automating Eclipse PDE Unit Tests using Ant</a> incredibly helpful. It prov...
<p>Here is a Tool which I can recommand if someone is interrested by TDD : <a href="http://www.junit.org/node/343" rel="nofollow noreferrer">Infinitest</a></p> <p>Short description extracted from the Infinitest site:</p> <blockquote> <p>What is Infinitest?</p> <p>Infinitest is a continuous test runner desig...
31,860
<p>I have a client that is asking me to give them a listing of every file and folder in the source code (and then a brief explanation of the source tree). Is there an easy way to create some sort of decently formatted list like this from a subversion repository?</p>
<p>You'll want the list command. Assuming you're using the command line client</p> <pre><code>svn list -R http://example.com/path/to/repos </code></pre> <p>This will give you a full recursive list of everything that's in the repository. Redirect it to a text file</p> <pre><code>svn list -R http://example.com/path/...
<p>Assuming it's available via HTTP - why not just give them a read-only login, and point them at the web address?</p>
12,497
<p>Is it possible to re-use ABS or PLA filament material from printed parts?</p> <p>If so, what is the techniques to reform it?</p>
<p>There are a few options.</p> <ol> <li>Machines are available which grind the used plastic into fine pieces, melt it down, and extrude it as filament to be reused. <a href="http://www.filabot.com/">Filabot</a> is perhaps the most well known.</li> <li>Depending on where you live the local recycling programs may accep...
<p>If you're more interested in the recycling and reuse aspect than the re-print aspect, you could melt all the scrap filament onto a cookie sheet or into a bar (like in a bread ban). You could then manually work the material, or use a CNC machine to carve out your next thing.</p> <p>This <a href="https://www.youtube....
101
<p>Is either:</p> <pre><code>&lt;a href="#"&gt;&lt;h1&gt;text here&lt;/h1&gt;&lt;/a&gt; </code></pre> <p>or</p> <pre><code>&lt;h1&gt;&lt;a href="#"&gt;text here&lt;/a&gt;&lt;/h1&gt; </code></pre> <p>"correct". Is there any benefit of using the first one, it seems more logical to me. Perhaps from an SEO point?</p>
<pre><code>&lt;h1&gt;&lt;a href="#"&gt;text here&lt;/a&gt;&lt;/h1&gt; </code></pre> <p>is correct, as HTML does not allow a block element (<code>&lt;h1&gt;</code>) within an inline element (<code>&lt;a&gt;</code>) (<a href="http://www.w3.org/TR/REC-html40/struct/global.html#h-7.5.3" rel="nofollow noreferrer">src</a>)....
<p>There ain't really much difference in this particular case. There are some things to point out though:</p> <ul> <li><code>&lt;h*&gt;</code> are block elements, <code>&lt;a&gt;</code> is an inline element by default. As others pointed out, XHTML does not allow block elements in inline elements, so if you did not red...
39,719
<p>I've written up a weekly-review GTD checklist for myself in TiddlyWiki, using <a href="http://www.tiddlytools.com/#CheckboxPlugin" rel="nofollow noreferrer">CheckboxPlugin</a>. After I'm finished with it each week, I'd like to click one link to uncheck (reset) all of the items on it, so it's ready for the next use.<...
<p>Try this (adapted from ChecklistScript's "resetall" code):</p> <pre><code>&lt;html&gt;&lt;form style="display:inline"&gt; &lt;input type="button" value="clear all" onclick=" var tid='SomeTiddler'; var list='tag1 [[tag 2]] tag3 tag4'; var tags=list.readBracketedList(); store.suspe...
<p>Try this (adapted from ChecklistScript's "resetall" code):</p> <pre><code>&lt;html&gt;&lt;form style="display:inline"&gt; &lt;input type="button" value="clear all" onclick=" var tid='SomeTiddler'; var list='tag1 [[tag 2]] tag3 tag4'; var tags=list.readBracketedList(); store.suspe...
20,761
<p>I've always been interested in developing a web search engine. What's a good place to start? I've heard of Lucene, but I'm not a big Java guy. Any other good resources or open source projects?</p> <p>I understand it's a huge under-taking, but that's part of the appeal. I'm not looking to create the next Google,...
<p>There are several parts to a search engine. Broadly speaking, in a hopelessly general manner (folks, <strong>feel free to edit</strong> if you feel you can add better descriptions, links, etc):</p> <ol> <li><p><strong>The crawler</strong>. This is the part that goes through the web, grabs the pages, and stores in...
<p>There are ports of Lucene. Zend have one freely available. Have a look at this quick tutorial: <a href="http://devzone.zend.com/node/view/id/91" rel="nofollow noreferrer">http://devzone.zend.com/node/view/id/91</a></p>
13,740
<p>I'm just reading Code Complete by Steve McConell and I'm thinking of an Example he gives in a section about loose coupling. It's about the interface of a method that calculates the number of holidays for an employee, which is calculated from the entry date of the employee and her sales. The author suggests a to have...
<p>The problems I see with your argument number 2 are</p> <ol> <li><p>you are assuming every needed value comes from an Employee instance. This is by no means always true. For example, say you have to consider the financial state of the company to calculate how much 'bonus holiday' give to any employee. Would you add ...
<p>I would say that one of the major benefits of loose coupling is the ease of change. Loosely coupled types can change independently of each other so I don't understand your "vs" in the question.</p> <p>Additionally, I would not say that you break encapsulation by providing parameters for the method. You can implemen...
47,266
<p>In WPF, there are two ways to set the focus to an element.<br> You can either call the .Focus() method of the input element, or call Keyboard.Focus() with the input element as parameter.</p> <pre><code>// first way: item.Focus(); // alternate way: Keyboard.Focus(item); </code></pre> <p>What is the difference betwe...
<p>One of the first things that <code>item.Focus()</code> does is call <code>Keyboard.Focus( this )</code>. If that fails, then it makes calls to <code>FocusManager</code>, as decasteljau has answered.</p> <p>The following are copied from disassambler view in <a href="http://reflector.red-gate.com/" rel="noreferrer">R...
<p>Also, you may want to know that item.Focus() is the equivalent of calling:</p> <pre><code>DependencyObject focusScope = FocusManager.GetFocusScope(item); if (FocusManager.GetFocusedElement(focusScope) == null) { FocusManager.SetFocusedElement(focusScope, item); } </code></pre>
23,960
<p>Can somebody tell me how to use the <em><code>printWhenExpression</code></em> of JasperReports?</p>
<p>Do you have an error relative to boolean ?</p> <p>Because you need to use Boolean instead of the primitive type.</p> <p>So: </p> <pre><code>$F{mesure} != "PH" ($F{userfd4}).equals("1") ? true : false </code></pre> <p>would give <code>cannot cast from boolean to Boolean</code>.</p> <pre><code>( $F{mesure}.start...
<p>$P{mesure}.equals("200") should work without any additional details. It will print if the condition is true</p>
37,670
<p>I have findbugs plugin for eclipse which when run on my project will show results in Bugs explorer clubbed by the type of bug.</p> <p>I need to be able to do two things:</p> <ul> <li>Export all these to excel sheet</li> <li>Find out the bugs reported in a set of files (and be able to do it recursively w/o running ...
<p>Findbugs dumps its results into an XML file in your workspace's .metadata folder. Look for the subfolder that's named something like findbugs.</p> <p>You can also download a standalone version of Findbugs that will save the results wherever you like.</p> <p>Once you have the results file, you might be able to impo...
<p>I had the same problem with findbugs some versions ago.</p> <p>I updated the plugin today to version 1.3.8 and found out that you can now export and even import reports as XML directly. </p> <p>All you have to do is right-click on a project either in the package explorer or in the findbugs "Bug explorer" and selec...
6,853
<p>We are beginning to go down the path of mobile browser support for an enterprise e-commerce webapp (Java/Servlet based). Of course there are many decisions to be made, but it seems to me the cornerstone is to be able to reliably detect mobile browsers, and make decisions on the content to be returned accordingly. ...
<p>Wouldn't the standard way be to check the user agent? Here's a <a href="http://wurfl.sourceforge.net/" rel="noreferrer">database of user agents</a> you can use to detect mobile browsers.</p>
<p>You will have to check the user agent string with a previously defined list, <a href="http://www.zytrax.com/tech/web/mobile_ids.html" rel="nofollow noreferrer">like this one</a></p>
17,199
<p>Does anyone know a simple algorithm to check if a Sudoku-Configuration is valid? The simplest algorithm I came up with is (for a board of size n) in Pseudocode</p> <pre><code>for each row for each number k in 1..n if k is not in the row (using another for-loop) return not-a-solution ..do the same for e...
<p>You need to check for all the constraints of Sudoku :</p> <ul> <li>check the sum on each row</li> <li>check the sum on each column</li> <li>check for sum on each box</li> <li>check for duplicate numbers on each row</li> <li>check for duplicate numbers on each column</li> <li>check for duplicate numbers on each box<...
<p>Let's say int sudoku[0..8,0..8] is the sudoku field.</p> <pre><code>bool CheckSudoku(int[,] sudoku) { int flag = 0; // Check rows for(int row = 0; row &lt; 9; row++) { flag = 0; for (int col = 0; col &lt; 9; col++) { // edited : check range step (see comments) if ((sudoku[row, col] ...
36,878
<p>I have been tasked with converting several php classes into java classes, which is quickly becoming a nightmare for me. I understand the basic language structure, it being similar to C. It is all of the function calls and class calls that seem to go nowhere and the fact that a var can be declared in the <strong>!mid...
<p>You ask about best practices. I believe a good practice in your case is the approach pleasantly presented by theman: using an automated tool will probably give a bad result: garbage in, garbage out...</p> <p>You have the code: analyze it, in its broad lines if necessary. And re-create it in Java. It might be time-c...
<p>I can not imagine that a tool for this is existing. I did something similar with C++ und Java. It is a pain, but the best is to impement it by your self.</p> <p>Or write it in C and create a dll with a jni warpper to call it from Java. This should be the fastet way.</p>
47,492
<p>The MEF team keep saying it is about plug-in model. So, are we talking about UI plugins? How can we use this stuff in non-UI code? I downloaded the code and the examples are all about GUI. Am I guessing it wrong?</p>
<p>Ilya</p> <p>MEF is absolutely not only for UI. Nothing about MEF is UI-dependent, which is why it lives in the System.ComponentModel namespace. You can use MEF in desktop apps, web apps, or services. </p> <p>In terms of samples, thank you for the feedback. We do need better samples that illustrate that it is a non...
<p>If you're talking about Microsoft <a href="http://code.msdn.microsoft.com/mef" rel="nofollow noreferrer">Managed Extensibility Framework</a> then no, it's definitely not just about UI. </p> <p>By doing something visual in the samples you just make it easier for people to understand the concept. You could not make i...
16,918
<p>I'm trying to figure out why the control does not honor ZIndex.</p> <p>Example 1 - which works fine</p> <pre><code> &lt;Canvas&gt; &lt;Rectangle Canvas.ZIndex="1" Height="400" Width="600" Fill="Yellow"/&gt; &lt;Rectangle Canvas.ZIndex="2" Height="100" Width="100" Fill="Red"/&gt; &lt;/Canvas&gt;...
<p>Unfortunately this is because the WebBrowser control is a wrapper around the Internet Explorer COM control. This means that it gets its own HWND and does not allow WPF to draw anything over it. It has the same restrictions as hosting any other Win32 or WinForms control in WPF.</p> <p><a href="http://msdn.microsof...
<p>I solved a similar issue where I was hosting a 3rd party WinForms control in my WPF application. I created a WPF control that renders the WinForms control in memory and then paints it to a bitmap. Then I use DrawImage in the OnRender method to draw the rendered content. Finally I routed mouse events from my contr...
10,901
<p>I have a form that contains a GridView control which is databound to an ObjectDataSource Control. There are several TextBox controls that are already being used as ControlParameters for the ObjectDataSource. I also have a custom data object that the ObjectDataSource is associated with {TypeName="myDataClass"}. The v...
<p>Multi-select list boxes are tricky. You need to loop through the items in code to build a list of selected values. So you will probably need to implement a custom parameter that does this for you.</p> <p>You might end up needing to bind to the grid from code-behind, instead of doing it declaratively.</p>
<p>This is typical problem. multi-select list box always return the first selected value and not all the selected value. We have to loop through the entire collection and check each individual value if selected or not.</p>
24,147
<p>I've been having this irritating issue lately. The site I'm currently working on has large aspx pages with tons of client side js code. While I'm typing the Error List window will keep opening and closing at the bottom of VS (where I have the window docked). I mean constantly. This is beyond aggravating as you can i...
<ol> <li>Try deleting the .user file in the project directory</li> <li>Use Add/Remove programs to do a repair on VS2008</li> <li>If neither of those work, copy the markup to a new project and attempt to reproduce. If you can reproduce this issue then update this question with details.</li> </ol>
<p>I finally found the options that were causing the issue.<br> 1. Options->Text Editor-> Miscellaneous, <br> &nbsp;&nbsp;&nbsp; un-check "Formal HTML on paste<br> 2. Options->Text Editor->JScript->Formatting<br> &nbsp;&nbsp;&nbsp;un-check The boxes under "Automatic Formatting"</p>
12,128
<p>I many times have to work with directories containing hundreds of thousands of files, doing text matching, replacing and so on. If I go the standard route of, say</p> <pre><code>grep foo * </code></pre> <p>I get the too many files error message, so I end up doing</p> <pre><code>for i in *; do grep foo $i; done </...
<p>In newer versions of findutils, find can do the work of xargs (including the glomming behavior, such that only as many grep processes as needed are used):</p> <pre><code>find ../path -exec grep foo '{}' + </code></pre> <p>The use of <code>+</code> rather than <code>;</code> as the last argument triggers this behav...
<p>I can't see that</p> <pre><code>for i in *; do grep foo $i done </code></pre> <p>would work since I thought the "too many files" was a shell limitation, hence it would fail for the for loop as well.</p> <p>Having said that, I always let xargs do the grunt-work of splitting the argument list into manageable bi...
22,517
<p>I have recently been doing a bit of investigation into the different types of Model View architectures, and need to decide which one to pursue for future in-house development. As I'm currently working in a Microsoft shop that has ASP.NET skills, it seems my options are between ASP.NET MVC and WCSF (Monorail is proba...
<blockquote> <p>ASP.NET MVC cannot use web controls that rely on postbacks, whereas WCSF can.</p> </blockquote> <p>You should think of WCSF as guidance about how to use the existing WebForms infrastructure, especially introducing Model-View-Presenter to help enforce separation of concerns. It also increases the test...
<p>Why not attach both to Northwind and see which fits best for you and your situation?</p>
7,694
<p>Is it possible to set a symbol for conditional compilation by setting up properties in an Xcode project?</p> <p>My aim is to to create a symbol that is available to all files, without having to use import/include, so that a set of common classes can have a special behavior in some projects. Like the following, but ...
<p>Go to your Target or Project settings, click the Gear icon at the bottom left, and select "Add User-Defined Setting". The new setting name should be <code>GCC_PREPROCESSOR_DEFINITIONS</code>, and you can type your definitions in the right-hand field.</p> <p>Per Steph's comments, the full syntax is:</p> <pre><code>...
<p>You can duplicate the target which has the preprocessing section, rename it to any name you want, and then change your Preprocessor macro value.</p>
47,948
<p>Today I was working on a tab navigation for a webpage. I tried the <a href="http://www.alistapart.com/articles/slidingdoors2/" rel="noreferrer">Sliding Doors</a> approach which worked fine. Then I realized that I must include an option to delete a tab (usually a small X in the right corner of each tab). </p> <p>I w...
<p>They must be doing some really crazy stuff with JavaScript to get it to work (notice how neither the parent nor the nested anchor tags have a name or href attribute - all functionality is done through the class name and JS).</p> <p>Here is what the html looks like:</p> <pre><code>&lt;a class="page_tab page_tab"&gt...
<p>Actually, the code I had pasted previously was the generated DOM, after all JS manipulation. If you don't have the <a href="https://addons.mozilla.org/en-US/firefox/addon/1843" rel="nofollow noreferrer">Firebug</a> extension for Firefox, you should get it now.</p> <p>Edit: Deleted the old post, it was no longer us...
4,130
<p>This should be simple. I'm trying to import data from Access into SQL Server. I don't have direct access to the SQL Server database - it's on GoDaddy and they only allow web access. So I can't use the Management Studio tools, or other third-party Access upsizing programs that require remote access to the database.</...
<p>Try using the <a href="http://blog.godaddyhosting.com/2007/07/20/presentingdrum-roll-please-the-ms-sql-backuprestore-feature.aspx" rel="nofollow noreferrer">GoDaddy SQL backup/restore tool</a> to get a local copy of the database. At that point, use the <a href="http://www.microsoft.com/technet/prodtechnol/sql/2000/d...
<p>It's never advisable to loop through records when a SQL Update can be used.</p> <p>It's not clear from your question what database interface layer you are using, but it is possible with the right interfaces to insert data from a source outside a database <em>if</em> the interface being used supports both types of d...
9,158
<p>I would like to change the "Row Source" values in an Access table through code. This way I can filter what a user can choose in a column's combo box.</p>
<p>I don't know whether or not this is an option for you, but I would recommend separating the table and filtering options, setting up a form to do the data entry and modification and using code to set the Row Source for the combo box on the form. As you've already seen, while Access does provide the opportunity to tre...
<p>Your question is quite confusing. "RowSource" is a property of a list box or combo box. A table does not have a RowSource, but, as Remou points out, Access allows you to define fields in your tables so that they display a combo box that looks up values from a related table. This combo box has a rowsource, so it's pe...
29,678
<p>I am in need of a case insensitive string enumeration type in my XML schema (.xsd) file. I can get case insensitive by doing the following.</p> <pre><code>&lt;xs:simpleType name="setDigitalPointType"&gt; &lt;xs:restriction base="xs:string"&gt; &lt;xs:pattern value="[Oo][Nn]" /&gt; &lt;xs:pattern...
<p>IBM developerWorks has <a href="https://web.archive.org/web/20091206195708/http://www.ibm.com/developerworks/xml/library/x-case/" rel="nofollow noreferrer">an article</a> on how to use XSLT to perform the construction of the full set of enumeration alternatives in an automated fashion. It is presented as a workaroun...
<p>Well, you could just list all the permutations as patterns :)</p>
46,875
<p>I need to change the functionality of an application based on the executable name. Nothing huge, just changing strings that are displayed and some internal identifiers. The application is written in a mixture of native and .Net C++-CLI code. </p> <p>Two ways that I have looked at are to parse the GetCommandLine() f...
<p>Call <a href="http://msdn.microsoft.com/en-us/library/ms683197(VS.85).aspx" rel="nofollow noreferrer">GetModuleFileName()</a> using 0 as a module handle.</p> <p><strong>Note:</strong> you <em>can</em> also use the <code>argv[0]</code> parameter to main or call <code>GetCommandLine()</code> if there is no main. Howev...
<p>I can confirm it works under win64/visual studio 2017/ MFC</p> <pre><code>TCHAR szFileName[MAX_PATH + 1]; GetModuleFileName(NULL, szFileName, MAX_PATH + 1); auto exe = CString(szFileName); </code></pre> <p>exe contains full path to exe.</p>
15,186
<p>There must be a generic way to transform some hierachical XML such as:</p> <pre><code>&lt;element1 A="AValue" B="BValue"&gt; &lt;element2 C="DValue" D="CValue"&gt; &lt;element3 E="EValue1" F="FValue1"/&gt; &lt;element3 E="EValue2" F="FValue2"/&gt; &lt;/element2&gt; ... &lt;/element1&gt; </code>...
<p>I'm not 100% sure of what you are trying to do but this solution may work if your element1, element2 and element3 are nested consistently.</p> <pre><code>&lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl"...
<p>We already have a Pro*C program reading from an Oracle database, it calls a perl script which in turn executes some Java to extract data in XML format from the aforementioned database for calling a batch file to execute some vbscript FTPing the file to some other server. I was really hoping for something in Fortran....
11,442
<p>I'm new to the WCSF and can't seem to find anything related to "building a custom template" for creating the views/presenters/code-behinds/etc with your own flavor ...</p> <p>Can anyone point me in the right direction?</p>
<p>If you're using <strong>Visual C++</strong> do the following: You include intrin.h and call the following functions:</p> <p>For 16 bit numbers:</p> <pre><code>unsigned short _byteswap_ushort(unsigned short value); </code></pre> <p>For 32 bit numbers:</p> <pre><code>unsigned long _byteswap_ulong(unsigned long val...
<p>Look up bit shifting, as this is basically all you need to do to swap from little -> big endian. Then depending on the bit size, you change how you do the bit shifting.</p>
13,080
<p>I'm trying to get a bare-bones example of logging going in my ASP.NET application. I would like to use the My.Log functionality to write out error log messages to a text log file. I have tried several things via Google but none of them seem to work. In general, when I use any of the properties of My.Log.DefaultFileW...
<p><a href="https://learn.microsoft.com/en-us/dotnet/visual-basic/developing-apps/programming/log-info/walkthrough-changing-where-my-application-log-writes-information" rel="nofollow noreferrer">Walkthrough: Changing Where My.Application.Log Writes Information </a></p>
<p>log4net is the bst option for logging in asp.net</p>
30,349
<p>We have a lot of dll-libraries written in both delphi and c++ builder, and use sharemem and borlndmm.dll.</p> <p>An aligment-issue in a 3thparty library forces us over to the new memorymanager in delphi 2007.</p> <p>Can someone please explain 'shared memory manager' for me?<br> Is SimpleShareMem a dropin replaceme...
<p>I think I found the answer to most of my questions in this thread: <a href="http://groups.google.com/group/borland.public.delphi.language.basm/browse_frm/thread/8b70a36f331f137e?ie=UTF-8&amp;oe=utf-8&amp;q=Re:+FastMM+questions" rel="nofollow noreferrer" title="borland.public.delphi.language.basm">borland.public.delp...
<p>Just have a look at <a href="https://forums.codegear.com/thread.jspa?threadID=6608" rel="nofollow noreferrer">https://forums.codegear.com/thread.jspa?threadID=6608</a> for an interesting discussion about this subject.</p>
39,237
<p>I've been arguing with my coworkers about Pascal casing (upper camel case) vs. lower <a href="http://en.wikipedia.org/wiki/CamelCase" rel="noreferrer">CamelCasing</a>. They are used to lower camel casing for everything from table names in SQL databases to property naming in C# code but I like Pascal casing better, l...
<p>I use what the Framework uses, as it's the de-facto best practice. However, so long as the code in your company is <strong>consistently</strong> using their style, then you're much better off getting used to it. If every developer has their own standard, then there's no standard at all.</p>
<p>The day when i quit programming - its when Microsoft will make CamelCase in C# as standard. Because my grown logic has many reasons for PascalCase, unlike kid's logic, who cares only shorter names or easier to write.</p> <p>And BTW: CamelCasing comes primarily from C++ STD library style, the native old language inh...
18,015
<p>We are in the early design stages of a major rewrite of our product. Right now our customers are mostly businesses. We manage accounts. User names for an account are each on their own namespace but it means that we can't move assets between servers.</p> <p>We want to move to a single namespace. But that brings the ...
<p><strong>EMAIL ADDRESS</strong></p> <p>Rational</p> <ol> <li>Users don't change emails very often</li> <li>Removes the step of asking for username and email address, which you'll need anyway</li> <li>Users don't often forget their email address (see number one)</li> <li>Email will be unique unless the user already ...
<p>OpenID seems to be a very good alternative to writing your own user management/authentication piece. I'm seeing more and more sites using OpenID these days, so the barrier to entry for your users should be relatively low.</p>
2,789
<p>We’re currently in the process of updating the email dispatch part of our application to replace the deprecated set of classes under System.Web.Mail with the System.Net.Mail classes. </p> <p>The changes have been fairly straightforward but we’ve hit an obstacle today in that we were trying to port the contents of ...
<p>Have a look at this site <a href="http://www.systemnetmail.com/" rel="nofollow noreferrer">http://www.systemnetmail.com/</a></p> <p>It should cover all the SMTP related fields that you need to map e.g. ssl, sendusing</p>
<p>which cdo fields are you trying to carry over?</p> <p>i know some CDO fields we used are now mapped to some properties in the SmtpClient object.</p>
46,006
<p>Should I prepare my code for possible/predicted future changes so that it's easier to make these changes even if I don't really know if these changes will be required anytime?</p>
<p>I am likely to get lynched for my opinion on this, but here I go.</p> <p>While I have had this hammered into me over years of reading idealistic articles and sitting through far too many seminars and lectures categorically stating the nirvana like benefits of this, I too had similar questions in my mind. This line...
<p>In two words: yes, always.</p>
47,312
<p>I was making the following call:</p> <pre><code>result = RegOpenKeyEx(key, s, 0, KEY_READ, &amp;key); </code></pre> <p>(C++, Visual Studio 5, Vista 64bit).</p> <p>It is failing with error code 2 ("File not found") even though "<code>regedit</code>" shows that the key exists. This code has always worked on 32bit ...
<p>I discovered that I could solve my problem using the flag: <code>KEY_WOW64_64KEY</code> , as in:</p> <pre><code>result = RegOpenKeyEx(key, s, 0, KEY_READ|KEY_WOW64_64KEY, &amp;key); </code></pre> <p>For a full explanation: <a href="http://msdn.microsoft.com/en-us/library/ms724072(VS.85).aspx" rel="noreferrer">3...
<p>I had a similar problem. I was using:</p> <pre><code>dwResult = RegOpenKeyEx(HKEY_LOCAL_MACHINE, (LPWSTR)"SOFTWARE\\0test", 0, WRITE_DAC , &amp;hKey); </code></pre> <p>That di...
31,440
<p>I'm very excited about the new "local F specs" coming in V6R1 - see:</p> <p><a href="http://www.mcpressonline.com/programming/rpg/v6r1-rpg-enhancements.html" rel="nofollow noreferrer">http://www.mcpressonline.com/programming/rpg/v6r1-rpg-enhancements.html</a></p> <p>Does anyone know a way to simulate this in V5R4 ...
<p>Fortunately or not, but OpenSSH client seems to be very picky about passwords and where they come from.</p> <p>You may try using <a href="http://www.lag.net/paramiko/" rel="nofollow noreferrer">Paramiko</a> Python SSH2 library. Here's a simple <a href="http://www.lag.net/pipermail/paramiko/2006-January/000180.html"...
<p>Reading <a href="http://pexpect.sourceforge.net/pexpect.html#spawn" rel="nofollow noreferrer">pexpect documentation for spawn</a>, I think it is waiting for the command to terminate.</p> <p>I would suggest a couple of different possibilities, depending on your needs:</p> <p>1) Kill the spawned process. However, th...
46,531
<p>I have forms in my page a get and a post and i want add pager on my get form .. so i cant page through the results.. </p> <p>The problem that i am having is when i move to the second page it does not display anything..</p> <p>I am using this library for paging .. <a href="http://stephenwalther.com/Blog/archive/200...
<p>I'd recommend against doing paging via HTTP POST. Page and search criteria are 2 perfect examples of what querystrings are meant for. Put those values in the query string &amp; have that load up your action args.</p> <p>Think about this. You can search google for "pies", navigate to page 14, copy the link and se...
<p>Of course it will hit the GET version of SearchByAttraction because using this control you have a links as output.</p> <p>So what you need to do:</p> <pre><code>1. make form on the page: &lt;form id="myForm" action="your/url" method="post"&gt; &lt;input type="hidden" name="page" /&gt; &lt;inpu...
48,176
<p>When I try to bind port 80 to a socket in c, i always get the error, that I don't have permission to use this port. is there an easy way to get this permission?</p>
<p>Usually only the superuser (root) can bind to 'privileged' ports (i.e. those port numbers below 1024).</p> <p>This means that you either have to run your program as root or make your executable 'suid root'.</p> <p>Both of these have security consequences so you may want to consider using the suid approach and reli...
<p>Yes, you can easily bind to port 80. Use Apache. Write a web application. Apache binds to port 80 and runs your web application. </p> <p>Are you trying to write the next Apache? If so, you'll need to learn about the <a href="http://www.manpagez.com/man/2/setuid/" rel="nofollow noreferrer">setuid</a> API call i...
20,411
<p>One of the things that seems to be necessary with use of STL is a way to specify local functions. Many of the functions that I would normally provide cannot be created using STL function object creation tools ( eg bind ), I have to hand roll my function object.</p> <p>Since the C++ standard forbids local types to b...
<p>The standard way is a "functor" - basically, a <code>struct</code> that supplies an <code>operator()</code></p> <p>For example:</p> <pre><code>struct MyMinFunctor { bool operator()(const int&amp; a, const int&amp; b) { return a &gt; b; } }; vector&lt;int&gt; v; sort(v.begin(), v.end(), MyMinFunctor()); </code><...
<p>With C++0x you can use lambda's (as you mentioned):</p> <pre><code>for_each(container.begin(), container.end(), [](auto item) { // do something with item } ); </code></pre> <p>This is already available in MS Visual C++ 2010 (currently in Community Tech Preview) and GCC 4.3.x (with the -std=c++0x compiler...
32,016