instruction
stringlengths
21
27.8k
chosen
stringlengths
18
28.2k
rejected
stringlengths
18
33.6k
__index_level_0__
int64
0
50k
<p>I'm using jQuery to post a form to a php file, simple script to verify user details.</p> <pre><code>var emailval = $("#email").val(); var invoiceIdval = $("#invoiceId").val(); $.post("includes/verify.php", {invoiceId:invoiceIdval , email:emailval }, function(data) { //stuff here. }); </co...
<p><code>$.post()</code> passes data to the underlying <code>$.ajax()</code> call, which sets <code>application/x-www-form-urlencoded</code> by default, so i don't think it's that.</p> <p>can you try this:</p> <pre><code>var post = $('#myForm').serialize(); $.post("includes/verify.php", post, function(data) { ...
<p>I had a case where I was using jQuery to disable all the inputs (even the hidden ones I wanted) just before using jQuery to submit the form. I changed my jQuery to only disable the "button" type inputs and now the hidden vars are posted when the form is submitted! It seems that if you set a hidden input to disable...
34,080
<p>Im trying to find out a good JavaScript library that can create a nice "inner-window" popup within a page on my site.</p> <p>I would like to not have to worry about screen positioning (i.e. dont have to calcuate if the size of the window will be off screen, etc...), but just make a new pop-up that has content in it...
<p><strong>Floating containers, panels and dialogs:</strong></p> <p>For dialog boxes and windows, perhaps a <a href="http://developer.yahoo.com/yui/container/module/" rel="nofollow noreferrer"><strong>YUI module</strong></a> would be a <strong>good solution</strong>.</p> <p><strong>Modal Boxes</strong></p> <p>If you...
<p>Thanks for the help so far, I have just taken a look at light box, and although very nice, I was hoping for a non-page-blocking library, these all seem to (at a first glace) grey-out the rest of the page, I was hoping for less of this, and more just an inline content based window that does not block the rest of the ...
24,372
<p>Can anybody let me know the query to find all the tables that has a date columns on it.</p> <p>Thanks</p>
<p>This should do the trick, just add in additional types if you need them:</p> <pre><code>select so.name table_name ,sc.name column_name ,st.name data_type from sysobjects so inner join syscolumns sc on (so.id = sc.id) inner join systypes st on (st.type = sc.type) where so.type = 'U' and st.name IN ('DATETI...
<p>I know that this is an old question, but I found it searching for similar problem solution.<br> This what I'm using:</p> <pre><code>SELECT DISTINCT OBJECT_NAME(col.OBJECT_ID) AS [TableName] FROM sys.all_columns col INNER JOIN sys.types typ ON col.user_type_id = typ.user_type_id WHERE col.user_ty...
46,740
<p>I'm trying to do a domain lookup in vba with something like this:</p> <pre><code>DLookup("island", "villages", "village = '" &amp; txtVillage &amp; "'") </code></pre> <p>This works fine until txtVillage is something like Dillon's Bay, when the apostrophe is taken to be a single quote, and I get a run-time error.</...
<p>The "Replace" function should do the trick. Based on your code above:</p> <pre><code>DLookup("island", "villages", "village = '" &amp; Replace(txtVillage, "'", "''") &amp; "'") </code></pre>
<p>My solution is much simpler. Originally, I used this SQL expression to create an ADO recordset:</p> <pre><code>Dim sSQL as String sSQL="SELECT * FROM tblTranslation WHERE fldEnglish='" &amp; myString &amp; "';" </code></pre> <p>When <code>myString</code> had an apostrophe in it, like Int'l Electrics, my program wo...
24,375
<p>If I have a control on a page that has its Datasource set to a DataReader, does that control consume the reader at the time the Datasource is set, or does the datareader continue to exist until Databind has been executed? </p> <p>What actually happens under the covers when Databind is executed?</p>
<p>Depending on the Control, DataBind() will Bind the Data to the Control. It does this by Iterating through the DataSource and create the Html and other Controls that are needed.</p> <p>For a DropDownList, DataBind() will create the ListItem for each record in a DataSet or each Element in an ArrayList.</p> <p>Later ...
<p>What is the control doing with the datareader during databind? Does it copy it into its internal structures and dispose of the datareader then render? </p> <p>If I have 10 controls on a page and set the datasource on each to a different datareader, then called page.databind, will the datareaders exist the entire ti...
22,269
<p>This seems like a pretty stupid question, but I'm trying to figure out the best way to do this. Would you simply redirect to a /Logout page and have the controller call the FormsAuthentication.SignOut function?</p> <p>That was my first thought, but then I wondered if it could be abused by third party websites. Le...
<p>If you are concerned about a user getting accidentally logged out of you application through the use of a malicious link, you can check the Referrer to make sure that the logout is coming from your site (or is NULL in the case where the user simply types the URL in).</p> <p>I actually don't worry about this since l...
<p>You should look for a cookie or something that identifies the client as the true user.</p>
27,140
<p>Does anybody know what hypothetical indexes are used for in sql server 2000? I have a table with 15+ such indexes, but have no idea what they were created for. Can they slow down deletes/inserts?</p>
<p>hypothetical indexes are usually created when you run index tuning wizard, and are suggestions, under normal circumstances they will be removed if the wizard runs OK. </p> <p>If some are left around they can cause some issues, see <a href="http://msdn.microsoft.com/en-us/library/ms190172(SQL.90).aspx" rel="nofollow...
<p>Hypothetical indexes are those generated by the Database Tuning Advisor. Generally speaking, having too many indexes is not a great idea and you should examine your query plans to prune those which are not being used.</p>
17,986
<p>I'm trying to install the .Net framework version 2.0 on embedded Windows XP SP2 (aka XPE).</p> <p>I'm using the XPE specific version of the installer from Microsoft:</p> <p><a href="http://www.microsoft.com/downloads/details.aspx?familyid=c4837dad-5719-4b63-8752-cb0a65802329&amp;displaylang=en" rel="nofollow noref...
<p>Okay, so you're running the installer that is updating your XPE development environment, right? Or are you attempting to run that on a device before you seal it?</p> <p>You need to run that installer on the workstation that has the XPE dev environment (and database) installed. The installer is looking for a speci...
<p>HI, i know how to fix it,</p> <p>just install futre-pack 2007 for w XP embedded =(.NET framework2.0 included) :D</p>
24,141
<p>Are the naming conventions similar in different languages? If not, what are the differences?</p>
<p>As others have said, things vary a lot, but here's a rough overview of the most commonly used naming conventions in various languages:</p> <p><code>lowercase, lowercase_with_underscores</code>:</p> <p>Commonly used for local variables and function names (typical C syntax).</p> <p><code>UPPERCASE, UPPERCASE_WITH_U...
<p>Years ago an wise old programmer taught me the evils of <a href="http://en.wikipedia.org/wiki/Hungarian_notation" rel="nofollow noreferrer">Hungarian notation</a>, this was a real legacy system, Microsoft adopted it some what in the Windows SDK, and later in MFC. It was designed around loose typed languages like C, ...
7,192
<p>I've got a combo-box that sits inside of a panel in Flex 3. Basically I want to fade the panel using a Fade effect in ActionScript. I can get the fade to work fine, however the label of the combo-box does not fade. I had this same issue with buttons and found that their fonts needed to be embedded. No problem. ...
<p>Hmm, I am not sure why that isn't working for you. Here is an example of how I got it to work:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="fx.play([panel])"&gt; &lt;mx:Style&gt; @font-face { ...
<p>Thanks for your help. Had exactly the same problem. The trick is in the embedding the "bold" version of the font you are using. Even though the font in your ComboBox isn't set to Bold ...</p>
3,900
<p>Has anyone used C# with a Sales Logix database?</p>
<p>Yes. I have.</p> <p>(Not the most interesting answer on SOB today, but that's what the question asked...)</p>
<p>Yes. I have.</p> <p>(Not the most interesting answer on SOB today, but that's what the question asked...)</p>
17,028
<p>How many ServiceContracts can a WCF service have?</p> <p>Specifically, since a ServiceContract is an attribute to an interface, how many interfaces can I code into one WCF web service? Is it a one-to-one?</p> <p>Does it make sense to separate the contracts across multiple web services?</p>
<p>WCF services can have multiple endpoints, each of which can implement a different service contract.</p> <p>For example, you could have a service declared as follows:</p> <pre><code>[ServiceBehavior(Namespace = "DemoService")] public class DemoService : IDemoService, IDoNothingService </code></pre> <p>Which would ...
<p>A service can theoretically have any number of Endpoints, and each Endpoint is bound to a particular contract, or interface, so it is possible for a single conceptual (and configured) service to host multiple interfaces via multiple endpoints or alternatively for several endpoints to host the same interface.</p> <p...
5,166
<p>I'm porting a process which creates a MASSIVE <code>CROSS JOIN</code> of two tables. The resulting table contains 15m records (looks like the process makes a 30m cross join with a 2600 row table and a 12000 row table and then does some grouping which must split it in half). The rows are relatively narrow - just 6 ...
<p>Examining that query shows only one column used from one table, and only two columns used from the other table. Due to the very low numbers of columns used, this query can be easily enhanced with covering indexes:</p> <pre><code>CREATE INDEX COSTCENTCoverCross ON COSTCENT(COST_CTR_NUM) CREATE INDEX JOINGLACCoverCr...
<p>Break down the query to make it a plain simple cross join.</p> <pre> <code> SELECT CC.COST_CTR_NUM, GL.ACCOUNT_NO ,CC.COST_CTR_NUM AS CA_COSTCENT ,GL.ACCOUNT_NO AS CA_GLACCOUNT ,GL.LI_LNTM AS CA_LNTM -- I don't know what is BUPDEF doing? but remove it from the query for...
46,258
<p>I'm not really asking about how programmers learn how to program. More about specific technologies. If I wanted to learn Hibernate, how do I know what I should know prior to Hibernate? Should I learn JPA before, during or after Hibernate? Is there a better solution to Hibernate? (And I'm not really looking for ...
<p>Sometimes the best way to learn is to just dig in to a framework. Sure, you could use someones wrapper API around something, but if there is something wrong w/ hibernate, then you wouldn't know what's happening.</p> <p>And to answer "how do i know what i should know prior to hibernate", you don't, that's why you ar...
<p>A lot of the time the documentation and/or tutorial for any technology or project will mention what prior knowledge is assumed or useful.</p> <p>So for example hibernate: <a href="http://www.hibernate.org/hib_docs/v3/reference/en/html_single/#tutorial-intro" rel="nofollow noreferrer">http://www.hibernate.org/hib_d...
12,140
<pre><code>int x = n / 3; // &lt;-- make this faster // for instance int a = n * 3; // &lt;-- normal integer multiplication int b = (n &lt;&lt; 1) + n; // &lt;-- potentially faster multiplication </code></pre>
<p>This is the fastest as the compiler will optimize it if it can depending on the output processor.</p> <pre><code>int a; int b; a = some value; b = a / 3; </code></pre>
<p>Easy computation ... at most n iterations where n is your number of bits:</p> <pre><code>uint8_t divideby3(uint8_t x) { uint8_t answer =0; do { x&gt;&gt;=1; answer+=x; x=-x; }while(x); return answer; } </code></pre>
20,654
<p>I am using cura with M3D entry level printer.</p> <p>When I print things more than 6-7cm/2.5-3inches, at the end of the print, the hot end sink back into the print then gets stuck as it tries to return to idle position.</p> <p>Please see the attached photo. Has anyone had this problem? Thank you<a href="https://...
<p>As Oscar commented, check the tail end of your gcode files. Most slicing software includes commands to move the head to x=0,y=0 at the very least. I am a bit surprised that your files don't appear to have this, since Cura does apply said code. </p> <p>Possiblly there's something lacking in your printer's firmware...
<p>As Oscar commented, check the tail end of your gcode files. Most slicing software includes commands to move the head to x=0,y=0 at the very least. I am a bit surprised that your files don't appear to have this, since Cura does apply said code. </p> <p>Possiblly there's something lacking in your printer's firmware...
1,033
<p>I have a windows mobile 5.0 app, written in C++ MFC, with lots of dialogs. One of the devices I'm currently targetting does not have a tab key, so I would like to use another key to move between controls. This is fine for buttons but not edit controls or combo boxes. I have looked at a <a href="https://stackoverf...
<p>I don't know MFC <strong>that good</strong>, but maybe you could pull it off by subclassing window procedures of all those controls with a single class, which would only handle cases of pressing cursor keys and pass the rest of events to the original procedures.</p> <p>You would have to provide your own mechanism o...
<p>Can you not use the D-Pad to navigate between fields?</p>
20,043
<p>I have written my program in c# .net. I want to convert it in to a powershell cmdlet. I was instructed to use pssnapin and getproc programs. Can anyone plz help me out..</p> <p>Regards Arun</p>
<p>So, here's the PSCmdlet-Class[from medata], that you can inherit from.</p> <pre><code>namespace System.Management.Automation { public abstract class PSCmdlet : Cmdlet { protected PSCmdlet(); public PSHost Host { get; } public CommandInvocationIntrinsics InvokeCommand { get; } ...
<p>Check also <a href="http://blogs.msdn.com/daiken/" rel="nofollow noreferrer">http://blogs.msdn.com/daiken/</a>. In particular all the months from February 2007 to June 2007. You'll find the Visual Studio template link (for 2005, also works in Express), and several examples/labs.</p>
47,246
<p>I've recently started work on the Compact Framework and I was wondering if anyone had some recommendations for unit testing beyond what's in VS 2008. MSTest is <em>ok</em>, but debugging the tests is a nightmare and the test runner is <em>so</em> slow.</p> <p>I see that NUnitLite on codeplex is an option, but it do...
<p>What we've done that really improves our efficiency and quality is to multi target our mobile application. That is to say with a very little bit of creativity and a few conditional compile tags and custom project configurations it is possible to build a version of your mobile application that also runs on the deskt...
<p>We use NUnitLite, although I think we did have had to add some code to it in order for it to work. </p> <p>One of the problems we found is that if you are using parts of the platform that only exist in CF, then you can only run those tests in NUnitLite on an emulator or Windows Mobile device, which makes it hard to...
3,531
<p>Is it possible to redirect all of the output of a Bourne shell script to somewhere, but with shell commands inside the script itself?</p> <p>Redirecting the output of a single command is easy, but I want something more like this:</p> <pre><code>#!/bin/sh if [ ! -t 0 ]; then # redirect all of my output to a file ...
<p>Addressing the question as updated.</p> <pre><code>#...part of script without redirection... { #...part of script with redirection... } &gt; file1 2&gt;file2 # ...and others as appropriate... #...residue of script without redirection... </code></pre> <p>The braces '{ ... }' provide a unit of I/O redirection....
<p>I finally figured out how to do it. I wanted to not just save the output to a file but also, find out if the bash script ran successfully or not!</p> <p>I've wrapped the bash commands inside a function and then called the function <code>main_function</code> with a tee output to a file. Afterwards, I've captured the ...
40,611
<p>When working on a big C/C++ project, do you have some specific rules regarding the <em>#include</em> within source or header files?</p> <p>For instance, we can imagine to follow one of these two excessive rules:</p> <ol> <li><em>#include</em> are forbidden in <em>.h</em> files; it is up to each <em>.c</em> file to...
<p>If you include H-files exclusively into C-files, then including a H-file into a C-file might cause compilation to fail. It might fail because you may have to include 20 other H-files upfront, and even worse, you have to include them in the right order. With a real lot of H-files, this system ends up to be an adminis...
<p>Pt. 1 fails when you would like to have precompiled headers through a certain header; eg. this is what StdAfx.h are for in VisualStudio: you put all common headers there...</p>
21,973
<p>I would like the fastest and most accurate function <code>boolean isReachable(String host, int port)</code> that passes the following JUnit tests under the conditions below. Timeout values are specified by the JUnit test itself, and may be considered "unreachable."</p> <p><strong>Please note:</strong> All answers m...
<p>Firstly you need to recognise that you have <em>potentially</em> conflicting requirements; IP sockets are not time deterministic. The quickest you can ever detect unreachability is after your elapsed timeout. You can only detect reachability quicker.</p> <p>Assuming reachability/isReachable is your real objective...
<p>My most recent solution depends using a <code>TimedSocket</code> (<a href="http://www.javaworld.com/jw-09-1999/jw-09-timeout.html" rel="nofollow noreferrer">source code</a>) with 3000ms timeout while performing a connect.</p> <p>Timings:</p> <ul> <li>1406ms : <code>testLocalHost()</code></li> <li>5280ms : <code>te...
23,696
<p>How to unit test the windows workflows?</p>
<p>K. Scott Allen has posted <a href="http://odetocode.com/Blogs/scott/archive/2006/08/02/5492.aspx" rel="nofollow noreferrer">this</a>, which provides an approach to unit testing custom activities (although he says that he is not satisfied). A similar approach is presented by Ron Jacobs <a href="http://blogs.msdn.com/...
<p>MS dropped the ball on making workflows easily mockable and testable. If you want to do thorough tests on your custom activities you'll need to purchase a mocking framework that can mock sealed types such as <a href="http://www.typemock.com/" rel="nofollow noreferrer">TypeMock.</a> Otherwise, you'll have to write ...
22,088
<p>I have a a property defined as:</p> <pre><code>[XmlArray("delete", IsNullable = true)] [XmlArrayItem("contact", typeof(ContactEvent)), XmlArrayItem("sms", typeof(SmsEvent))] public List&lt;Event&gt; Delete { get; set; } </code></pre> <p>If the List&lt;> Delete has no items</p> <pre><code>&lt;delete /&gt; </code>...
<p>If you set IsNullable=false or just remove it (it is false by default), then the "delete" element will not be emitted. This will work only if the collection equals to null.</p> <p>My guess is that there is a confusion between "nullability" in terms of .NET, and the one related to nullable elements in XML -- those t...
<p>You could always implement IXmlSerializer and perform the serialization manually.</p> <p>See <a href="http://www.codeproject.com/KB/cs/IXmlSerializable.aspx" rel="nofollow noreferrer">http://www.codeproject.com/KB/cs/IXmlSerializable.aspx</a> for an example.</p>
9,470
<p>Could somebody please explain to me what happens here?<br> I am creating a binding in code. </p> <p>The target object is a UserControl<br> The target property is a boolean DependencyProperty<br> The source object is a FrameworkElement and implements INotifyPropertyChanged<br> The source property is of type Observa...
<p>Alright, I found the answer myself. This is a bug in Silverlight..</p> <p>The code that does the following </p> <pre><code>if (PropertyChanged != null) { PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); } </code></pre> <p>must be directly on the class that you bind to, not on its an...
<p>For anyone else who is experiencing this: <strong>make sure you are implementing INotifyPropertyChanged on your ViewModel</strong>!</p>
36,012
<p>Can anybody have good answer when should be database driven development be used and when should domain driven development be used. These both development approach have their importance in their respected areas. But I am not so clear which approach is appropriate in what type of situation. Any recommendation?</p>
<p>First for some background, Martin Fowler actually described three different "patterns" in his book Patterns of Enterprise Arcitecture. Transaction Script, Active Record and Domain Model. DDD uses the domain model pattern for the overall architecture and describes a lot of practices and patterns to implement and desi...
<p>Domain Driven Development is surely the way to go. it makes more sense and adds flexibility.</p>
39,747
<p>With common lisp and I am assuming the introspection properties. How can I add code to common lisp code that will tell me when a function is called and when has finished executing. I want to take any lisp code and this particular modification to the code. I figure with lisp's AST analysis, this should be possible...
<p>You can use <a href="http://www.sbcl.org/manual/Function-Tracing.html" rel="nofollow noreferrer"><code>(trace function)</code></a> for a simple mechanism. For something more involved, here is a good discussion from <a href="http://groups.google.com/group/comp.lang.lisp/browse_thread/thread/75ddcdcc160508b0?pli=1" re...
<p>Common lisp has a TRACE function that reports the function, arguments and resulting value of each call specified. Here is the doc page for Steel Bank's version, but you should find something similar in most implementations:</p> <p><a href="http://www.sbcl.org/manual/Function-Tracing.html" rel="nofollow noreferrer">...
28,674
<p>I've often read that corporations will save millions once Internet Explorer 6 is finally laid to rest, but reading quotes like that make me wonder just how much time people are spending on IE6 development. I'll be happy once IE6 goes, but I've found that if I write valid HTML and CSS, use a JavaScript framework, kee...
<p>According to <a href="http://www.w3schools.com/browsers/browsers_stats.asp" rel="nofollow noreferrer">some</a> - <a href="http://www.adtech.info/news/pr-08-07_en.htm" rel="nofollow noreferrer">browser</a> - <a href="http://www.thecounter.com/stats/2008/September/browser.php" rel="nofollow noreferrer">statistics</a>,...
<p>Unfortunately, I have a bunch of friends in other businesses that are sticking with IE6, and don't have a plan to upgrade.</p> <p>They don't like the tabs in IE7, they don't want to go with another browser, etc, etc, etc.</p> <p>There is enough of this that filters back to me, that I continue to test against IE6, ...
25,624
<p>I come from a Java background, where packages are used, not namespaces. I'm used to putting classes that work together to form a complete object into packages, and then reusing them later from that package. But now I'm working in C++.</p> <p>How do you use namespaces in C++? Do you create a single namespace for the...
<p>Namespaces are packages essentially. They can be used like this:</p> <pre><code>namespace MyNamespace { class MyClass { }; } </code></pre> <p>Then in code:</p> <pre><code>MyNamespace::MyClass* pClass = new MyNamespace::MyClass(); </code></pre> <p>Or, if you want to always use a specific namespace, you can ...
<p>std :: cout</p> <p>The prefix std:: indicates that the names cout and endl are defined inside the namespace named std. Namespaces allow us to avoidinadvertent collisions between the names we define and uses of those same names inside a library. All the names defined by the standard library are in the stdnamespace....
6,292
<p>as a follow up on my <a href="https://stackoverflow.com/questions/318208/cast-to-combined-generic">previous question</a> Having a function with combined generic bounds such as:</p> <pre><code>&lt;T extends Foo &amp; Bar&gt; void doStuff(T argument) { //do stuff wich should only be done if arguments is both foo an...
<p>I wouldn't consider combined generic bounds an anti-pattern. At least I've got some uses for them in my code. For instance, the following sample code finds the biggest Number instance in a collection using compareTo from the Comparable interface:</p> <pre><code>&lt;T extends Number &amp; Comparable&lt;T&gt;&gt; T m...
<p>The anti-pattern is casting.</p> <p>However, fancy generics footwork may be confusing to non-advanced programmers. Usage of such types and method should be much easier than their implementation.</p>
41,419
<p>Over the last few months/years, I have shared a folder or two with numerous people on my domain. How do I easily revoke those shares to keep access to my system nice and tidy?</p>
<p>Using computer management (an MMC snap-in. See Control Panel Administrative tools) you can see a list of all folders that are shared. You could delete the shares or change the permissions on the share to only allow access for certain people or groups.</p>
<p>On Windows XP, go to:</p> <pre><code>Administrative Tools &gt; Computer Management &gt; System Tools &gt; Shared Folders &gt; Shares </code></pre> <p>This page lists all shares and lets you remove them easily, in one place.</p>
4,583
<p>I need to show only one element at a time when a link is clicked on. Right now I'm cheating by hiding everything again and then toggling the element clicked on. This works, unless i want EVERYTHING to disappear again. Short of adding a "Hide All" button/link what can i do? I would like to be able to click on the lin...
<pre><code>$("#linkgarykhit").click(function(){ if($("#infogarykhit").css('display') != 'none'){ $("#infogarykhit").hide(); }else{ $("#infocontent *").hide(); $("#infogarykhit").show(); } return false; }); </code></pre> <hr> <p>We could also <a href="http://en.wikipedia.org/wiki/Don%27t_...
<p>I just started with <code>jQuery</code>, so I don't know if this is dumb or not.</p> <pre><code>function DoToggleMagic(strParagraphID) { strDisplayed = $(strParagraphID).css("display"); $("#infocontent *").hide(); if (strDisplayed == "none") $(strParagraphID).toggle(); } $(document).ready(function(){ /...
20,387
<p>For some reason when I attempt to make a request to an Ajax.net web service with the ScriptService attribute set, an exception occurs deep inside the protocol class which I have no control over. Anyone seen this before?</p> <p>Here is the exact msg: System.IndexOutOfRangeException: Index was outside the bounds of t...
<p>This is usually an exception while reading parameters into the web service method...are you sure you're passing the number/type of parameters the method is expecting?</p>
<p>Also make sure your web.config is setup properly for asp.net ajax:</p> <p><a href="https://web.archive.org/web/20080914214955/http://asp.net/ajax/documentation/live/ConfiguringASPNETAJAX.aspx" rel="nofollow noreferrer">http://www.asp.net/AJAX/Documentation/Live/ConfiguringASPNETAJAX.aspx</a></p>
11,207
<p>My 3D printer makes weird sounds. When it's at >75% printing speed the extruder motor makes a "tac tac" sound and it goes backwards, pushing the filament back, for a small interval of time. I have tried changing the nozzle temperature and I'm unable to work this out alone. </p> <p>Has someone had the same problem?<...
<p>@Ecnerwal is right: that noise you hear is the extruder not being able to push the filament, and the stepper can't push any harder. When the extruder tries to push harder than it can, it gives up, and the "spring" tension it created in the filament forces it to go backwards a tiny bit. Then it tries again.</p> <p>P...
<p>It could be a result of filament building up around the drive gear.</p> <ul> <li>disassemble your extruder to expose the drive gear (the gear that drives the filament down to the heat element). </li> <li>clean any filament build-up out of the the teeth.</li> </ul> <p>Filament can sometimes build up around the gear...
636
<p>I am aware of <a href="http://cocoamysql.sourceforge.net/" rel="noreferrer">CocoaMySQL</a> but I have not seen a Mac GUI for SQLite, is there one?</p> <p>My Google search didn't turn up any Mac related GUI's which is why I'm asking here rather than Google.</p>
<p><a href="https://addons.mozilla.org/en-US/firefox/addon/5817" rel="noreferrer">SQLite Manager for FireFox</a></p>
<p>Razorsql can handle many kinds of databases.</p>
12,625
<p>I made previously a question: <a href="https://stackoverflow.com/questions/236354/error-handling-when-taking-user-input">error handling when taking user input</a></p> <p>and I made the suggested changes:</p> <pre><code>char displayMainMenu() { char mainMenuChoice; cout &lt;&lt; "\nQuadratic equation: a*X^2 + b*X +...
<p>In your <code>displayMainMenu()</code> function, instead of reading in a <code>char</code>, read in a string. Throw out (with a warning) any input that is greater than one character in length.</p> <p>You can use</p> <pre><code>char str[101] std::cin.getline(str, 101); </code></pre> <p>in place of </p> <pre><cod...
<p>Try this:</p> <pre><code>string displayMainMenu() { string mainMenuChoice; cout &lt;&lt; "\nQuadratic equation: a*X^2 + b*X + c = 0 main menu: "; cout &lt;&lt; "\n &lt;r&gt; Give new coefficients"; cout &lt;&lt; "\n &lt;c&gt; Calculate equations solutions"; cout &lt;&lt; "\n &lt;t&gt; Term...
29,263
<p>i tried the following</p> <ol> <li><code>svnadmin create svn_repos</code></li> <li><code>svn import my_first_proj file:///c:/svn_repos -m "initial import"</code></li> <li><code>svn checkout file:///c:/svn_repos</code></li> </ol> <p>and the command returned</p> <pre><code>A svn_repos\trunk A svn_repos\trunk\...
<p>Perhaps you're expecting to find that .svn directory inside the my_first_proj directory. Currently, your svn is checked out inside a "svn_repos" directory, relative to the path you typed in the checkout command. What you may want to do is :</p> <pre><code>svn checkout --force file:///c:/svn_repos/ my_first_proj </...
<p>Please provide some more details:</p> <p>What directory are you in when you perform each command?</p> <p>It looks to me like you may be checking out your project into the repository itself?</p> <p>Also, what operating system are you using?</p>
35,049
<p>Please help!</p> <p><em>Background info</em></p> <p>I have a WPF application which accesses a SQL Server 2005 database. The database is running locally on the machine the application is running on.</p> <p>Everywhere I use the Linq DataContext I use a using { } statement, and pass in a result of a function which r...
<p>From <a href="http://msdn.microsoft.com/en-us/library/bb292288.aspx" rel="noreferrer">MSDN</a> (<code>DataContext Constructor (IDbConnection)</code>):</p> <blockquote> <p>If you provide an open connection, the DataContext will not close it. Therefore, do not instantiate a DataContext with an open connection...
<p>The <code>Dispose</code> should close the connections, as <a href="http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnection.close.aspx" rel="nofollow noreferrer">MSDN</a> points out:</p> <blockquote> <p>If the SqlConnection goes out of scope, it won't be closed. Therefore, you must explicit...
33,767
<p>I am stress testing a .NET web application. I did this for 2 reasons: I wanted to see what performance was like under real world conditions and also to make sure we hadn't missed any problems during testing. We had 30 concurrent users in the application using it as they would during the normal course of their jobs....
<p>This is just something that I thought of, but check to see how much memory SQL Server is using when you have 20+ users - one of the limitations of the Express version is that it is <a href="http://www.microsoft.com/sql/prodinfo/features/compare-features.mspx" rel="nofollow noreferrer">limited to 1GB of RAM</a>. So i...
<p>Update: Looks like SQL Server express is not the problem as they were using the same product in previous version of the application. I think your next step is in identifying the bottlenecks. If you are sure it is in the database layer, I would recommend taking a profiler trace and bringing down the execution time of...
8,352
<p>I am trying to use <code>ResourceBundle#getStringArray</code> to retrieve a <code>String[]</code> from a properties file. The description of this method in the documentation reads:</p> <blockquote> <p>Gets a string array for the given key from this resource bundle or one of its parents.</p> </blockquote> <p>Howe...
<p>A <code>Properties</code> object can hold <strong><code>Object</code>s</strong>, not just <code>String</code>s. That tends to be forgotten because they're overwhelmingly used to load .properties files, and so often will only contain <code>String</code>s. <a href="https://web.archive.org/web/20081217073139/http://jav...
<pre><code>key=value1;value2;value3 String[] toArray = rs.getString("key").split(";"); </code></pre>
27,943
<p>I've seen both done in some code I'm maintaining, but don't know the difference. Is there one?</p> <p>let me add that myCustomer is an instance of Customer</p>
<p>The result of both are exactly the same in your case. It will be your custom type that derives from <code>System.Type</code>. The only real difference here is that when you want to obtain the type from an instance of your class, you use <code>GetType</code>. If you don't have an instance, but you know the type name ...
<p>The typeof operator takes a type as a parameter. It is resolved at compile time. The GetType method is invoked on an object and is resolved at run time. The first is used when you need to use a known Type, the second is to get the type of an object when you don't know what it is.</p> <pre><code>class BaseClass { } ...
16,886
<p>I have committed, and pushed, several patches: A1-->A2-->A3-->A4 (HEAD)</p> <p>Everyone's pulled these changesets into their local copy.</p> <p>Now we want to "roll back" to A2, and continue developing from there - essentially throwing away A3 and A4. What's the best way to do this?</p>
<p>From the root directory of your working copy just do</p> <pre><code>git checkout A2 -- . git commit -m 'going back to A2' </code></pre> <hr> <p>Using <a href="http://www.kernel.org/pub/software/scm/git/docs/git-revert.html" rel="noreferrer"><code>git revert</code></a> for this purpose would be cumbersome, since...
<p>You want <code>git-revert</code> <strike>and <code>git-reset</code> depending on how you want to treat A3 and A4. To remove all trace of A3 and A4, use <code>git-reset --hard</code>.</strike> To keep A3 and A4 and record the fact you are reverting, use <code>git-revert</code>. </p> <p><strong>edit</strong>: Aristot...
26,810
<p>I'm not a C++ developer, but I've always been interested in compilers, and I'm interested in tinkering with some of the GCC stuff (particularly LLVM).</p> <p>On Windows, GCC requires a POSIX-emulation layer (cygwin or MinGW) to run correctly.</p> <p>Why is that?</p> <p>I use lots of other software, written in C++...
<p>Actually, the question premise is wrong: <a href="http://www.mingw.org/" rel="noreferrer">MinGW</a> GCC does <strong>NOT</strong> require Cygwin.</p> <p>You will see you don't need Cygwin at all. It runs natively on Windows (32-bit, at least). Both the toolchain and the produced binaries are independent of Cygwin.<...
<p>Because the people behing GCC hate Windows with a passion (read Stallman some day). So when porting GCC to Windows, they do their best to pretend it's just another Unix.</p> <p>That, and they probably don't want to spend time on removing POSIX dependencies from the code.</p>
22,783
<p>I'm setting up my first site using the asp authentication provider and using the built in asp.net login control.</p> <p>My question, is the password encrypted or hashed as it's sent to the server using the asp.net login control? or do I need to use https/ssl to accomplish this?</p> <p>Thanks</p>
<p>Go with HTTPS.</p> <p>Per <a href="http://msdn.microsoft.com/en-us/library/ms178329.aspx" rel="noreferrer">MSDN</a>, "By default, the ASP.NET login controls work in plain text over HTTP. If you are concerned about security, use HTTPS with SSL encryption."</p>
<p>The any text based data is sent as is to the server regardless of the language used by the server as this is controlled by the HTML Framework. You can create a Javascript encryption or hash algorith and use that prior to submitting the form data.</p> <p>However the most secure method would be to use HTTPS.</p>
27,595
<p>What are the differences between these two and which one should I use?</p> <pre><code>string s = &quot;Hello world!&quot;; String s = &quot;Hello world!&quot;; </code></pre>
<p><a href="https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/string" rel="noreferrer"><code>string</code></a> is an alias in C# for <a href="https://learn.microsoft.com/en-us/dotnet/api/system.string" rel="noreferrer"><code>System.String</code></a>.<br /> So technically, there is no differenc...
<p>There are at least 4 differences:</p> <p>1- string is a reserved word, but String is just a class name. This means that string cannot be used as a variable name by itself.</p> <p>2- you can't use String without &quot;using System&quot;.so you write less code by using &quot;string&quot;.</p> <p>3- 'String' is better ...
2,871
<p>I once heard a prominent scientist say, of global warming, that he didn't realize how much he would have to learn about politics.</p> <p>I just read an excellent article in DDJ about the <a href="http://en.wikipedia.org/wiki/Jacobsen_v._Katzer" rel="nofollow noreferrer">Jacobsen verus Katzer</a> case. When in unive...
<p><a href="http://www.groklaw.net/" rel="nofollow noreferrer">groklaw</a> would seem to be a good starting point for open source issues</p>
<p>The Nolo book <em>Legal Guide to Web &amp; Software Development</em> discusses copyright and other issues as they pertain to software developers.</p> <p><a href="https://rads.stackoverflow.com/amzn/click/com/1413305326" rel="nofollow noreferrer" rel="nofollow noreferrer">http://www.amazon.com/Legal-Guide-Software-D...
26,447
<p>near the top of the code i see things like, </p> <p>btn_dropdown._visible = false; mcMenuBkg._visible = false;</p> <p>but I can't find these assets anywhere in the library or in any code, how does this make any sense?</p> <p>The movie clips in the library that look the same have different names and I can delete t...
<p>In theory, any clip you see at runtime could be dynamically created, by making an empty MC and drawing in whatever contents you like with the drawing API. However, if you see clips in the library that are similar to what's showing up at runtime, then it's very unlikely that that's happening.</p> <p>Your first step ...
<p>You can create movie clips with code dynamically.</p> <p>This means that you may not have them in your assets if you are unable to find them.</p> <p>You can create any type of symbol using a constructor out of thin air with actionscript alone.</p> <p>I would search the code for one of these</p> <pre><code>var my...
28,498
<p>I know you can put &lt;% if %> statements in the ItemTemplate to hide controls but the column is still there. You cannot put &lt;% %> statements into the LayoutTemplate which is where the column headings are declared, hence the problem. Does anyone know of a better way?</p>
<p>Here's another solution that I just did, seeing that I understand what you want to do:</p> <p><strong>Here's your ASCX / ASPX</strong></p> <pre><code> &lt;asp:ListView ID="ListView1" runat="server" DataSourceID="MyDataSource" ItemPlaceholderID="itemPlaceHolder" OnDataBound="ListView1_DataBound"&gt; &lt;...
<p>You can always set the column width to 0 (zero) if you don't find a better way.</p>
9,622
<p>I'm trying to leverage the using block more and more these days when I have an object that implements IDisposable but one thing I have not figured out is how to catch an exception as I would in a normal try/catch/finally ... any code samples to point me in the right direction?</p> <p>Edit: The question was modified...
<p>I don't really understand the question - you throw an exception as you normally would. If <code>MyThing</code> implements <code>IDisposable</code>, then:</p> <pre><code>using ( MyThing thing = new MyThing() ) { ... throw new ApplicationException("oops"); } </code></pre> <p>And <code>thing.Dispose</code> wi...
<p>You need to have a try statement to catch an exception </p> <p>Either you can use an try statement within the using block or you can use a using block in a try block </p> <p>But you need to use a try block to catch any exceptions occuring </p>
5,673
<p>If I have 3 different views which are defined in 3 corresponding functions, namely:</p> <pre><code>- (UIView *)getView1 { /*...*/ } - (UIView *)getView2 { /*...*/ } - (UIView *)getView3 { /*...*/ } </code></pre> <p>These are added to <code>self.view</code> when a particular view is required.</p> <p>My question is...
<p>You can tag each view with with an integer and later read the tag to determine which view is active (assuming you are replacing <code>self.view</code>).</p> <pre><code>#define TAG_VIEW_1 1 #define TAG_VIEW_2 2 #define TAG_VIEW_3 3 ... [ [self getView1()] setTag:TAG_VIEW_1 ]; [ [self getView2()] setTag:TAG_VIEW_2 ];...
<p>All UIView's have a <a href="http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UIView_Class/UIView/UIView.html#//apple_ref/occ/instp/UIView/window" rel="nofollow noreferrer">window property</a> which is set when it is being displayed in a window and set to nil when it is removed. You can get t...
49,129
<p>My <a href="http://rads.stackoverflow.com/amzn/click/B007KG0ZYI" rel="noreferrer">12V DC 30A Power Supply 360W Power Supply</a> is really cheap, and it's worked well for setting up the motors; but now that I'm on to the heated bed, which uses considerably more Ampage than that of just the motors, I'll confess, I'm g...
<p>A MK2 heatbed will draw around 12A. The motors and hotend draw only very little power (around 2A, 5A peak), so the 30A supply you have has significant headroom (it is often recommended to derate a power supply by 20%, so a 30A supply would be good for 24A - you're still well under that). It should work fine, even gi...
<p>I've used a similar cheap psu before. It'll work without blowing up but my heatbed struggled to get up to 60c, swapped psus with one I had lying around from a desktop and there was a huge difference. </p>
382
<p>How can one get Visual Studio 2005/2008 to reference assemblies in the 64-bit GAC instead of the 32-bit GAC? We are settin the target platfom to x64 and the compiler is throwing the error of</p> <blockquote> <p>Error 2 Warning as Error: Assembly generation -- Referenced assembly 'System.Data.dll' targets a differ...
<p>I'm not sure why you would need to do this. .NET code that isn't specifically compiled for 32 bit will run 64 bit if it can. This includes the base framework libraries. In short, there is no reason that I know of to compile your assemblies specifically for 64 bit (other than referencing unmanaged 64 bit dlls, but yo...
<p>Have you set x64 platform for all projects in your solution in Configuration Manager ?</p>
27,786
<p>Google is not being my friend - it's been a long time since my stats class in college...I need to calculate the start and end points for a trendline on a graph - is there an easy way to do this? (working in C# but whatever language works for you)</p>
<p>OK, here's my best pseudo math:</p> <p>The equation for your line is:</p> <p>Y = a + bX</p> <p>Where:</p> <p>b = (sum(x*y) - sum(x)sum(y)/n) / (sum(x^2) - sum(x)^2/n)</p> <p>a = sum(y)/n - b(sum(x)/n)</p> <p>Where sum(xy) is the sum of all x*y etc. Not particularly clear I concede, but it's the best I can do w...
<p>Thank You so much for the solution, I was scratching my head.<br> Here's how I applied the solution in Excel.<br> I successfully used the two functions given by MUHD in Excel:<br> a = (sum(x*y) - sum(x)sum(y)/n) / (sum(x^2) - sum(x)^2/n)<br> b = sum(y)/n - b(sum(x)/n)<br> (careful my a and b are the b and a in MUHD'...
6,483
<p>I understand what <a href="http://msdn.microsoft.com/en-us/library/ms404247.aspx" rel="noreferrer">System.WeakReference</a> does, but what I can't seem to grasp is a practical example of what it might be useful for. The class itself seems to me to be, well, a hack. It seems to me that there are other, better means ...
<p>One useful example is the guys who run DB4O object oriented database. There, WeakReferences are used as a kind of light cache: it will keep your objects in memory only as long as your application does, allowing you to put a real cache on top.</p> <p>Another use would be in the implementation of weak event handlers....
<p>There are two reasons why you would use <code>WeakReference</code>. </p> <ol> <li><p><strong>Instead of global objects declared as static</strong>: Global objects are declared as static fields and static fields cannot be GC'ed (garbage-collected) until the <code>AppDomain</code> is GC'ed. So you risk out-of-memory ...
3,637
<p>I know that this question has already been asked <a href="https://stackoverflow.com/questions/41207/javascript-interactive-shell-with-completion">HERE</a> but sadly none of the answers suggest a javascript standalone shell that has auto completion. I am reopening this question again, in the hope that some new answe...
<p>According to <a href="http://blog.norrisboyd.com/2008/03/better-line-editing-for-rhino-shell.html" rel="noreferrer">this blog post</a>, autocompletion is now available for <a href="https://developer.mozilla.org/en/Rhino_Shell" rel="noreferrer">Rhino</a>, as long as the <a href="http://jline.sourceforge.net/" rel="no...
<p>If you're looking at client side Javascript, have you looked at <a href="http://getfirebug.com/" rel="nofollow noreferrer">Firebug</a>? It gives you command completion for the current window - including any pulled in libraries, etc?</p> <p>You can run it as a plugin from Firefox, or include it in any web pages for ...
32,609
<p>I'm working now on a page that has a column of boxes styled with sexy shadows and corners and whatnot using the example <a href="http://www.schillmania.com/content/projects/even-more-rounded-corners/" rel="nofollow noreferrer">here</a>. I have to admit, I don't fully understand how that CSS works, but it <em>looks<...
<p>Jeremy,</p> <p>Sorry for this being so late, but hopefully the answer will be of use to you in a future project.</p> <p>The problem here is that IE creates a new stacking order anytime there is an element with position:relative, meaning that z-index itself is not the only controlling factor. You can read more abo...
<p>I'm not <em>totally</em> understanding the setup that's leading to the problem, but you might want to explore the useIFrame property of the YUI Autocomplete object -- it layers an iframe object beneath the autocomplete field, which allows the field to then float above the objects that are obscuring it in IE's buggy ...
11,454
<p>I'm looking for an implementation of CRC32 in C or C++ that is explicitly licensed as being no cost or public domain. The implementation <a href="http://www.networkdls.com/Software/View/CRC32" rel="noreferrer">here</a> seems nice, but the only thing it says about the license is "source code", which isn't good enoug...
<p>Use the <a href="http://www.boost.org/" rel="noreferrer">Boost C++ libraries</a>. There is a <a href="http://www.boost.org/doc/libs/release/libs/crc/index.html" rel="noreferrer">CRC</a> included there and the <a href="http://www.boost.org/LICENSE_1_0.txt" rel="noreferrer">license</a> is good.</p>
<p><a href="https://github.com/rurban/smhasher" rel="nofollow noreferrer">rurban's fork of SMHasher</a> (the original SMHasher seems abandoned) has hardware CRC32 support. The changes were added before the initial commit, but try comparing <a href="https://github.com/rurban/smhasher/blame/fbb0fda71354140899a9c347c3057d...
38,910
<p>I have a simple HTML upload form, and I want to specify a default extension ("*.drp" for example). I've read that the way to do this is through the ACCEPT attribute of the input tag, but I don't know how exactly.</p> <pre><code>&lt;form enctype="multipart/form-data" action="uploader.php" method="POST"&gt; Upload DR...
<p>I use javascript to check file extension. Here is my code:</p> <p>HTML</p> <pre><code>&lt;input name="fileToUpload" type="file" onchange="check_file()" &gt; </code></pre> <p>.. ..</p> <p>javascript</p> <pre><code>function check_file(){ str=document.getElementById('fileToUpload').value.toUpperCas...
<p>Another solution with a few lines</p> <pre><code>function checkFile(i){ i = i.substr(i.length - 4, i.length).toLowerCase(); i = i.replace('.',''); switch(i){ case 'jpg': case 'jpeg': case 'png': case 'gif': // do OK stuff break; default: // do error stuff break; }...
31,698
<p>I'd like them to be easy to bundle, with few dependencies and easy to use.</p>
<p>Do you want to highlight Java code or use a Java lib to highlight some other code?</p> <p>I use these two: <a href="https://jhighlight.dev.java.net/" rel="noreferrer">https://jhighlight.dev.java.net/</a> (server-side) for xml and <a href="http://code.google.com/p/syntaxhighlighter/" rel="noreferrer">http://code.goo...
<p>RSyntaxTextArea is worked for me<a href="http://bobbylight.github.io/RSyntaxTextArea/" rel="nofollow">Here</a></p> <pre><code> RSyntaxTextArea textArea = new RSyntaxTextArea(); textArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVA); textArea.setCodeFoldingEnabled(true); RTe...
27,316
<p>I'm working on a simple little function to download a file from an SSL-enabled website using the WinInet functions, namely InternetOpen and InternetOpenURL. I had was initially failing the call to InternetOpenURL with a <code>ERROR_INTERNET_INVALID_CA</code> (12045) because I was using a self-signed certificate on...
<p>I used to receive similar error. I then passed the handle returned by a HttpOpenRequest(...) to InternetQueryOption and it worked just fine. Try it out.</p>
<p>I see you're not checking the <code>hReq</code> you get back from <code>InternetOpen</code>. Perhaps that is the root of your problem. See what this tells you if you add it right after the call to <code>InternetOpen</code>:</p> <pre><code>if (hReq == NULL) { printf("InternetOpen Error: %d", GetLastError()); } <...
35,286
<p>I am pretty new to php, but I am learning! I have a simple form on a client website. I am testing the form and when I click submit, I get the following error:</p> <p>Form Mail Script</p> <pre><code>Wrong referrer (referring site). For security reasons the form can only be used, if the referring page is part of this ...
<p>You are obviously using the Form Mail script on your page. It has a security feature that prevents other domains from submitting to the form. This is done to prevent bots from using the script to send out spam.</p> <p>In the configuration for the form mail script or in the script itself, you will find an array or v...
<p>Doing a quick search for the error you're seeing, I found this link: <a href="http://www.stadtaus.com/forum/t-3528.html" rel="nofollow noreferrer">http://www.stadtaus.com/forum/t-3528.html</a> </p> <p>Not sure if that helps you in this case since I'm unfamiliar with the tool you're using but it seemed like a good...
33,351
<p>We have consumed a third party web service and are trying to invoke it from an ASP.NET web application. However when I instantiate the web service the following System.InvalidOperationException exception is thrown:</p> <blockquote> <p>Method 'ABC.XYZ' can not be reflected. System.InvalidOperationException: M...
<p>I ran into the same problem earlier today. The reason was - the class generated by Visual Studio and passed as a parameter into one of the methods did not have a default parameterless constructor. Once I have added it, the error had gone.</p>
<p>I got the same message but mine was caused by a missing System.Runtime.Serialization.dll since I tried to run a 3.5 application on a machine with only .NET 2.0 installed.</p>
16,088
<p>I'm not sure if this a settings problem or an HTML problem, but on a page layout I'm working on, Firefox does not render the stylesheet immediately. Meaning for maybe half a second I can see the unstyled page, then the stylesheet kicks in and it renders as I expect.</p> <p>All my stylesheets are in external css fil...
<p>Try disabling firebug.</p>
<p>In my case turning off Firebug didn't help. From the other hand I happend to use <strong>@import</strong> in my css and when i removed it - the <strong>FOUC</strong> (Flash Of Unstyled Content) was gone. That is very strange because this behaviour is mostly referred to <strong>IE</strong> (<a href="http://www.bluero...
49,318
<p>I have seen 3d surface plots of data before but i do not know what software i could use to make it.</p> <p>I have 3 series of data (X, Y, Z) basically i want each of the rows on the table to be a point in 3d space, all joined as a mesh. The data is currently csv, but i can change the format, as it is data i genera...
<p>If your x &amp; y points topologically lie on a grid, then you can use MESH. They don't need to have even spacing; they just need to be organized so that x(r:r+1,c:c+1) and y(r:r+1,c:c+1) define a quadrilateral on your mesh, for each row r and column c.</p> <p>If your data do not lie on a grid, but you know what t...
<p>gnuplot or <a href="http://www.scilab.org/" rel="nofollow noreferrer">scilab</a></p> <p>Below is a script for SciLab that I wrote awhile back. It reads in three columns separated by tabs. You can easily change this to fit your needs, pretty self-explanatory. Here is a quick guide to <a href="http://spiff.rit.edu/cl...
33,502
<p>I want to initialize a struct element, split in declaration and initialization. This is what I have:</p> <pre><code>typedef struct MY_TYPE { bool flag; short int value; double stuff; } MY_TYPE; void function(void) { MY_TYPE a; ... a = { true, 15, 0.123 } } </code></pre> <p>Is this the way to declare a...
<p>In (ANSI) C99, you can use a <strong>designated initializer</strong> to initialize a structure:</p> <pre><code>MY_TYPE a = { .flag = true, .value = 123, .stuff = 0.456 }; </code></pre> <p>Other members are initialized as zero: &quot;Omitted field members are implicitly initialized the same as objects that have stati...
<p>I've been looking for a nice way to initialize my struct, and I've got to using the below (C99). This lets me initialize either a single structure or an array of structures in the same way as plain types.</p> <pre><code>typedef struct { char *str; size_t len; jsmntok_t *tok; int tsz; } jsmn_ts; #de...
42,850
<p>I need to allow other Python applications to register callback functions for events in my application. These need to have priorities associated with them (so a callback with a priority of 10 runs before a callback with a priority of 1) and callback functions need to be able to signal errors to the dispatcher.</p> ...
<p>Are these other applications running in another address space? If so, you'll need to use an interprocess communication library like <a href="http://www.freedesktop.org/wiki/Software/dbus" rel="nofollow noreferrer">D-BUS</a>.</p> <p>If you're just sending signals in the same process, try <a href="http://pypi.python....
<p>What platform are you running under? GObject is the basis of the GTK GUI that's widely-used under Linux, and it supports event loops with prioritizable events like this.</p>
14,389
<p>Can I convert a string representing a boolean value (e.g., 'true', 'false') into a intrinsic type in JavaScript?</p> <p>I have a hidden form in HTML that is updated based upon a user's selection within a list. This form contains some fields which represent boolean values and are dynamically populated with an intrin...
<h1>Do:</h1> <pre><code>var isTrueSet = (myValue === 'true'); </code></pre> <p>using the identity operator (<code>===</code>), which doesn't make any implicit type conversions when the compared variables have different types.</p> <p>This will set <code>isTrueSet</code> to a boolean <code>true</code> if the string is &q...
<p>Just do a:</p> <pre><code>var myBool = eval (yourString); </code></pre> <p>Examples:</p> <pre><code>alert (eval ("true") == true); // TRUE alert (eval ("true") == false); // FALSE alert (eval ("1") == true); // TRUE alert (eval ("1") == false); // FALSE alert (eval ("false") == true); // FALSE; alert (eval ("fals...
33,059
<p>In Oracle, what is the difference between :</p> <pre><code>CREATE TABLE CLIENT ( NAME VARCHAR2(11 BYTE), ID_CLIENT NUMBER ) </code></pre> <p>and</p> <pre><code>CREATE TABLE CLIENT ( NAME VARCHAR2(11 CHAR), -- or even VARCHAR2(11) ID_CLIENT NUMBER ) </code></pre>
<p>Let us assume the database character set is UTF-8, which is the recommended setting in recent versions of Oracle. In this case, some characters take more than 1 byte to store in the database.</p> <p>If you define the field as <code>VARCHAR2(11 BYTE)</code>, Oracle can use up to 11 bytes for storage, but you may not...
<p>In simple words when you write <code>NAME VARCHAR2(11 BYTE)</code> then only 11 Byte can be accommodated in that variable.</p> <p>No matter which characters set you are using, for example, if you are using Unicode (UTF-16) then only half of the size of Name can be accommodated in <code>NAME</code>.</p> <p>On the oth...
10,710
<p>I have a very painful library which, at the moment, is accepting a C# string as a way to get arrays of data; apparently, this makes marshalling for pinvokes easier. </p> <p>So how do I make a ushort array into a string by bytes? I've tried:</p> <pre><code>int i; String theOutData = ""; ushort[] theImageData = in...
<p>P/Invoke can actually handle what you're after most of the time using StringBuilder to create writable buffers, for example see <a href="http://www.pinvoke.net/search.aspx?search=GetWindowText" rel="noreferrer">pinvoke.net on GetWindowText and related functions</a>.</p> <p>However, that aside, with data as ushort, ...
<p>I don't like this much, but it seems to work given the following assumptions:</p> <p><strong>1.</strong> Each ushort is an ASCII char between 0 and 127</p> <p><strong>2.</strong> (Ok, I guess there is just one assumption)</p> <pre><code> ushort[] data = inData; // The ushort array source Byte[] ...
34,538
<p>I'm messing around with 2D game development using C++ and DirectX in my spare time. I'm finding that the enterprisey problem domain modeling approach doesn't help as much as I'd like ;)</p> <p>I'm more or less looking for a "best practices" equivalent to basic game engine design. How entities should interact with e...
<p><a href="http://www.gamedev.net" rel="noreferrer">Gamedev.net</a> is usually where I turn to get an idea of what other people in the game development community are doing.</p> <p>That said, I'm afraid that you'll find that the idea of "best practices" in game development is more volatile than most. Games tend to be ...
<p>Since it has not been mentioned yet, why not start by looking at an existing engine that has been released to the community? Since you're talking 2D, I would go way back and recommend something like <a href="http://abuse.zoy.org/browser/abuse/trunk" rel="nofollow noreferrer"><strong>Abuse</strong></a>. Yes, it's anc...
21,683
<p>I have used an update command to update the whole table in an Sql Server 2000 database by mistake. I was actually meaning to update just one row. Now all the 2000 rows contain the update. Is there a way to roll back this change?</p>
<p>Unless you started your update with an explicit transaction, no.</p> <p>However, you might be able to use <a href="http://www.red-gate.com/products/SQL_Log_Rescue/index.htm" rel="nofollow noreferrer">Log Rescue</a> . I'm not sure though if this can help you in this case. </p> <p>A better option might be to restore...
<p>No, not unless you have a backup to revert to.</p> <p>I've done that mistake once. Now I start every manual operation with BEGIN TRAN. The worst that can happen then is that you forget to COMMIT TRAN and keep a lock on the table.</p>
35,901
<p><a href="https://i.stack.imgur.com/Bujra.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Bujra.png" alt="0.200 mm layer height, single wall" /></a></p> <p><a href="https://i.stack.imgur.com/gCYkr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gCYkr.png" alt="0.075 mm layer heig...
<p>The fact that these are all perfectly spaced, and don't mirror the edges of irregular prints, makes me think it's definitely not ghosting. That said, I can't see the Y direction on either print, just the X direction, so this all assumes it's only happening in one direction. One thing to think about: Your motors have...
<p>This is a great blog post, <a href="https://www.evernote.com/shard/s211/client/snv?noteGuid=701c36c4-ddd5-4669-a482-953d8924c71d&amp;noteKey=1ef992988295487c98c268dcdd2d687e&amp;sn=https%3A%2F%2Fwww.evernote.com%2Fshard%2Fs211%2Fsh%2F701c36c4-ddd5-4669-a482-953d8924c71d%2F1ef992988295487c98c268dcdd2d687e&amp;title=T...
1,189
<p>I need to take a Word document that is a template of sorts...collect user input to populate specific fields in that template..then generate a PDF file that includes the completed template as well as a few other document types. Does anyone have a good suggestion on a component to achieve this? Preferably one that doe...
<p>Try Aspose Words for .net. From their website: "Aspose.Words enables .NET and Java applications to read, modify and write Word® documents without utilizing Microsoft Word." Utilizing Aspose Words with Aspose PDF permits you to output to PDF.</p> <p>One thing you do NOT want to do is install MS Word on your producti...
<p>Is there a reason to use Word? If you start with a PDF with Form fields, you can either allow the user to fill out the fields, or do it programatically with iTextSharp's PDF stamper. </p> <p>If you need to use MSOffice 2000/2003 components programmatically, you can try Office Web Components. They do need to be inst...
11,094
<p>I have a base class in which I want to specify the methods a child class must have, but not implement them itself. However, the methods in a child class may have a different number of paramaters to the definition in the base class.</p> <p>Having tried this with an abstract method, php doesn't allow this. Is it poss...
<p>Short of specifying the abstract method with no parameters and requiring the subclassed method to access the args through func_get_args, I don't see how this would be possible.</p>
<p>I don't think this is an answer that you will want to use in production as it will be fairly slow, but just for the sake of it I tried to write something using Reflection, which seems to work. You will still get an E_STRICT because method declarations in subclasses are apparently supposed to match.</p> <pre><code>c...
47,223
<p>I've printed mostly ABS in the past and encountered <a href="https://www.google.com/#q=3d+printing+layer+delamination">delamination</a> between layers many times. I've ensured the following conditions regularly:</p> <ul> <li>Build plate is level</li> <li>Base of print isn't warped (using ABS slurry)</li> <li>Preven...
<p>Cool environmental conditions are the single biggest contributor to ABS delamination. Delamination or edge/corner cracking is caused by warping stresses when the first layer adhesion is stronger than the interlayer bonding. Or it happens when the heated build plate allows a strong non-warping foundation to be built ...
<p>wall size and filling are also parameters. If wall size is too thin delamination is more visible</p>
273
<p>I have two Django projects and applications running on the same Apache installation. Both projects and both applications have the same name, for example myproject.myapplication. They are each in separately named directories so it looks like .../dir1/myproject/myapplication and .../dir2/myproject/myapplication. <...
<p>Set the <a href="http://docs.djangoproject.com/en/dev/topics/http/sessions/#session-cookie-domain" rel="noreferrer">SESSION&#x5F;COOKIE&#x5F;DOMAIN</a> option. You need to set the domain for each of your sites so the cookies don't override each other.</p> <p>You can also use SESSION&#x5F;COOKIE&#x5F;NAME to make t...
<p>Well, if they have the same project and application names, then the databases and tables will be the same. Your django_session table which holds the session information is the same for both sites. You have to use different project names that will go in different MySQL (or whatever) databases.</p>
42,388
<p>What is the best way to make a <code>&lt;div&gt;</code> fade away after a given amount of time (without using some of the JavaScript libraries available).</p> <p>I'm looking for a very lightweight solution not requiring a huge JavaScript library to be sent to the browser.</p>
<p>Not sure why you'd be so against using something like jQuery, which would make accomplishing this effect all but trivial, but essentially, you need to wrap a series of changes to the -moz-opacity, opacity, and filter:alpha CSS rules in a setTimeout().</p> <p>Or, use jQuery, and wrap a fadeOut() call in setTimeout. ...
<p>I know you're down on libraries, but I'd recommend taking a look at moo.fx: <a href="http://moofx.mad4milk.net/" rel="nofollow noreferrer">http://moofx.mad4milk.net/</a> - I think it's like 3k.</p> <p>jQuery is pretty damn small too.</p>
15,101
<p>I've just installed MediaWiki on a web server. Obviously it needs lots of privileges during installation to set up its database correctly. Now that it's installed can I safely revoke some privileges (e.g. create table, drop table?) Or might it need to create more tables later (when they are first needed?) If not...
<p>After the installation, MediaWiki doesn't need to create any more tables. I'd suggest giving the user insert, select, and lock permission.</p> <pre><code>grant select,lock tables,insert on media_wiki_db.* to 'wiki'@'localhost' identified by 'password'; </code></pre>
<p>Change the user that mediawiki connects as in LocalSettings.php and then using phpMyAdmin, you can edit the privileges of that user (that is, if you aren't comfortable granting and revoking privileges from the mysql console).</p> <p><a href="http://www.phpmyadmin.net/home_page/index.php" rel="nofollow noreferrer">h...
13,107
<p>Is enterprise library for exception handling and logging efficient in terms of its memory usage for the functionality provided?</p> <p>What are the pros and cons? Thanks </p>
<p>I doubt that the enterprise library is going to be your performance bottleneck. I'd say use it, measure your application's performance, find the bottleneck and go from there. Fretting about what performance <em>might</em> be isn't going to give you any useful data for your scenario.</p> <p>That said, I've had good ...
<p>Given the larger memory and faster processing of today's (and recent) computers, I did not have inefficiency problems. The efficiency I found in the enterprise library is that I did not have to write and test it myself. And, because of its consistency and documentation, I don't have to spend much time teaching it ...
22,772
<p>I want to display print dialog in servlet/jsp. Below is my code:</p> <pre><code>DocFlavor flavor = DocFlavor.BYTE_ARRAY.AUTOSENSE; PrintRequestAttributeSet pras = new HashPrintRequestAttributeSet () ; PrintService printService[] = PrintServiceLookup.lookupPrintServices(flavor, pras); PrintService defaultService = P...
<p>You need to be aware that it is not the client that is executing your code here. It's the server.</p> <p>You'll have to make a javascript function for that to work.</p>
<p>I would call <code>window.print();</code> in javascript. Try it below.</p> <pre><code>&lt;html&gt; &lt;body&gt; &lt;a href="javascript:print()"&gt;Print&lt;/a&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
43,791
<p>I'm trying to compile code from F# to use in Silverlight. I compile with:</p> <p>--noframework --cliroot "C:\program Files\Microsoft Silverlight\2.0.31005.0" --standalone</p> <p>This generates a standalone assembly that references the SL framework. But when I try to add a reference to the generated assembly, I ge...
<p><strong>Answer!</strong></p> <p>Apparently the problem is that when you add a reference to the bin\Release or bin\Debug, Visual Studio (or the Silverlight project system) decides to try to reference the project. This fails for whatever reason.</p> <p>If you copy the F# output DLL to another location, then the refe...
<p>Visual Studio uses the IsSilverlightAssembly() function in the Microsoft.VisualStudio.Silverlight.SLUtil type to check if a reference can be set.</p> <p>David Betz has a nice blog post describing the details <a href="http://www.netfxharmonics.com/2008/12/Reusing-NET-Assemblies-in-Silverlight" rel="nofollow noreferr...
29,325
<p>Sorry for asking an implement my feature question type question last time. I am new to Stackoverflow.com and also to php that's why.</p> <p>What I was trying to ask is:</p> <p>I have made a admin account. Members have registration page so a member will register. When user registers in the database table I will h...
<p>Try this:</p> <pre><code>echo '&lt;td&gt;&lt;a href="http://yourwebsite/yourscriptname.php?action=del&amp;amp;member_id=' . htmlspecialchars($row['member_id']) . '"&gt;Delete&lt;/a&gt;'; if ($row['approved'] == 0) { echo '&amp;nbsp;&lt;a href="http://yourwebsite/yourscriptname.php?action=approve&amp;amp;memb...
<p>What I would do is to set up a form inside of the table.</p> <p><code>?&gt; &lt;form name="deleteUser" id="deleteUser" method="post" action=""&gt; &lt;input type="hidden" name="member_id" id="member_id" value="&lt;?php echo $row['member_id'] ?&gt; &lt;input type="submit" name="action" id="action" value="del" /&gt; ...
47,225
<p>I'm trying to resize an embedded object. The issue is that when the mouse hovers over the object, it takes "control" of the mouse, swallowing up movement events. The result being that you can expand the div containing the object, but when you try to shrink it, if the mouse enters the area of the object the resize ...
<p>Well I was utterly unable to find a XPS Document Viewer example or whatnot, but I was able to come up with <a href="http://www.rootspot.com/stackoverflow/box.php" rel="nofollow noreferrer"><code>this working sample</code></a>. It doesn't use the overlay idea, but it's a pdf that you can resize...</p> <p><strong>edi...
<p>Overlay.</p> <p>One word answers prohibited, this sentence no verb.</p>
21,193
<p>Greetings.</p> <p>I'm trying to implement some multithreaded code in an application. The purpose of this code is to validate items that the database gives it. Validation can take quite a while (a few hundred ms to a few seconds), so this process needs to be forked off into its own thread for each item.</p> <p>The ...
<p>The thread pool is a convenient choice if you have <em>light weight</em> sporadic processing that isn't time sensitive. However, I recall reading on MSDN that it's not appropriate for large scale processing of this nature.</p> <p>I used it for something quite similar to this and regret it. I took a worker-thread ap...
<p>I would be concerned about performance here. You indicated that the database may give it 20-30 items per second and an item could take up to a few seconds to be validated. That could be quite a large number of threads -- using your metrics, worst case 60-90 threads! I think you need to reconsider the design here....
17,480
<p>In TFS when you merge branch A to branch B and checkin, you get a single changeset on B (typically with a comment like "merged A->B"). </p> <p>This means B doesn't have any of the checkin history from A. So if someone created a new file on branch A, you can't tell who created it from branch B. And if someone upd...
<p>TFS 2010 will include support for this.</p> <p>Brian Harry talks about it in <a href="http://channel9.msdn.com/pdc2008/TL52/" rel="noreferrer">this presentation</a>.</p> <p>You will now be able to see where a change originated and who made it after the change has been merged to a different branch.</p>
<p>Might want to try the TFS Follow branch History tool:</p> <p><a href="http://www.codeplex.com/TFSBranchHistory" rel="nofollow noreferrer"><a href="http://www.codeplex.com/TFSBranchHistory" rel="nofollow noreferrer">http://www.codeplex.com/TFSBranchHistory</a></a></p>
6,789
<p>Given a document written with normal quotes, e.g.</p> <pre><code>Ben said "buttons, dear sir". I replied "Did you say 'buttons'?" to him. </code></pre> <p>What ways can one turn these sort of things into LaTeX quotes, with the appropriate semantics. i.e.</p> <pre><code>Ben said ``buttons, dear sir''. I replied ``...
<p>In general, this problem is harder than it looks.</p> <p>The simplest cases <em>can</em> be treated with regular expressions, but for more general situations you will almost certainly need to build a recursive parser: regular expression will only work if there is no nesting.</p> <p>The big problem is going to be a...
<p>Simply, use `` for opening quotations and '' for closing</p>
45,092
<p>I have two strings</p> <pre><code>&lt;EM&gt;is &lt;i&gt;love&lt;/i&gt;&lt;/EM&gt;,&lt;PARTITION /&gt; </code></pre> <p>and</p> <pre><code>&lt;EM&gt;is &lt;i&gt;love&lt;/i&gt;,&lt;PARTITION /&gt; </code></pre> <p>I want a regex to match the second string completely but should not match the first one. Please help...
<p>If you want to match a string entirely if it does not contain a certain substring, use a regex to match the substring, and return the whole string if the regex does not match. You didn't say which language you're using, but you tagged your question with .NET, so here goes in C#:</p> <pre><code>if (Regex.IsMatch(su...
<p>I don't think you're asking the right question. This regex matches the second string completely and not the first:</p> <pre>/^&lt;EM&gt;is &lt;i&gt;love&lt;\/i&gt;,&lt;PARTITION \/&gt;$/</pre> <p>But obviously, you want to match a class of strings, not just the second string... right? Define the class of strings...
41,365
<p>Sometimes, when we're doing small changes to our web apps, e.g. bug fixes, we don't build a whole new WAR-file each time, but merely replace just the affected class files in the exploded web app directory under <code>WEB-INF/classes</code> and restart the app.</p> <p>Is that okay?</p>
<p>I'd say that probably isn't a best practice, because of versioning: how do you know which version of the application you've got deployed? If you deploy a .war file your build process can take care of updating a build number (from source control, or separately, whatever - as long as each build has a different number ...
<p>Agree with PHill; it seems the time savings are negligible and the potential risks are many</p>
27,279
<p>I recently discussed editors with a co-worker. He uses one of the less popular editors and I use another (I won't say which ones since it's not relevant and I want to avoid an editor flame war). I was saying that I didn't like his editor as much because it doesn't let you do find/replace with regular expressions.<...
<p>Just last week, I used regex find/replace to convert a CSV file to an XML file.</p> <p>Simple enough to do really, just chop up each field (luckily it didn't have any escaped commas) and push it back out with the appropriate tags in place of the commas.</p>
<p>The first thing I do with any editor is try to figure out it's Regex oddities. I use it all the time. Nothing really crazy, but it's handy when you've got to copy/paste stuff between different types of text - SQL &lt;-> PHP is the one I do most often - and you don't want to fart around making the same change 500 t...
7,510
<p>I'm working on a system with four logical CPS (two dual-core CPUs if it matters). I'm using make to parallelize twelve trivially parallelizable tasks and doing it from cron.</p> <p>The invocation looks like:</p> <pre><code>make -k -j 4 -l 3.99 -C [dir] [12 targets] </code></pre> <p>The trouble I'm running into i...
<p>I'd drop the '-l'</p> <p>If all you plan to run the the system is this build I <em>think</em> the -j 4 does what you want.</p> <p>Based on my memory, if you have anything else running (crond?), that can push the load average over 4.</p> <p><a href="http://sunsite.ualberta.ca/Documentation/Gnu/make-3.79/html_chapt...
<p>Does make think one of the targets is failing? If so, it will stop the make after the running jobs finish. You can use -k to tell it to continue even if an error occurs.</p>
5,589
<p>In my existing (Pre-SVN 1.5) merge strategy, we create a copy of the Trunk (called BasePoint) at the moment of branch-creation for referencing later during the merge.</p> <p>When we need to merge a branch back into the trunk, we perform 2 operations.</p> <ol> <li><p>Merge from BasePoint to LatestTrunk (Trunk has lik...
<p>The short answer is, <strong>You still have to do both steps.</strong></p> <p><a href="http://svnbook.red-bean.com/en/1.5/svn-book.html#svn.branchmerge.basicmerging" rel="noreferrer">The SVN book</a> explains the process for merging as:</p> <ol> <li>svn merge <a href="http://trunk/path" rel="noreferrer">http://tru...
<p>I believe reintegrate does not actually do the two operations, but instead is used to merge back into trunk from an updated branch. You will still need to do the first set of merge/commit operations to update the branch first.</p> <p>Here is a link to the <a href="http://svnbook.red-bean.com/en/1.5/svn-book.html#sv...
20,965
<p>I'm doing a website for a family member's wedding. A feature they requested was a photo section where all the guests could go after the wedding and upload their snaps. I said this was a stellar idea and I went off to build it.</p> <p>Well there's just the one problem: logistics. Upload speeds are slow and photos fr...
<p>The most common solution for this is a java applet, although most of them are not free. Examples:</p> <ul> <li><a href="http://www.jumploader.com/" rel="nofollow noreferrer">http://www.jumploader.com/</a></li> <li><a href="http://www.aurigma.com/Products/ImageUploader/OnlineDemo.aspx" rel="nofollow noreferrer">http...
<p>GIMP (<a href="http://www.gimp.org/" rel="nofollow noreferrer">http://www.gimp.org/</a>) is a good tool for doing resize and is open source.</p>
9,996
<p>Our web site (running Rails) freezes IE6 nearly every time. The same code, deployed on a different server, does not freeze IE6. Where and how should we start tracking this down?</p>
<p>You need to determine the difference between them, so I'd start out with the following:</p> <pre><code>curl -D first.headers -o first.body http://first.example.com curl -D second.headers -o second.body http://second.example.com diff -u first.headers second.headers diff -u first.body second.body </code></pre>
<p>Perhaps some more info that will help you.</p> <p>We had the same problem and narrowed it also down to the GZIP compression. The key was that we had gzip compression on for our ScriptResources, which also deliver the javascripts used by the controls in our .NET page.</p> <p>Apperently there is a bug in IE6 that ca...
16,811
<p>I'm playing with an embedded Linux device and looking for a way to get my application code to communicate with a web interface. I need to show some status information from the application on the devices web interface and also would like to have a way to inform the application of any user actions like uploaded files ...
<p>I recently did something very similar using sockets, and it worked really well. I had a Java application that communicates with the device, which listened on a server socket, and the PHP application was the client.</p> <p>So in your case, the PHP client would initialize the connection, and then the server can reply...
<p>Embedded linux boxes for routing with web interface don't use PHP. They use CGI and have shell scripts deliver the web page.</p> <p>For getting information from the application to the web interface, the Shared file option seems most reasonable to me. The application can just write information into the file which is...
42,718
<p>In rails I want to log some information in a different log file and not the standard development.log or production.log. I want to do this logging from a model class.</p>
<p>You can create a Logger object yourself from inside any model. Just pass the file name to the constructor and use the object like the usual Rails <code>logger</code>:</p> <pre><code>class User &lt; ActiveRecord::Base def my_logger @@my_logger ||= Logger.new("#{Rails.root}/log/my.log") end def before_save...
<p>The Logging framework, with its deceptively simple name, has the sophistication you crave!</p> <p>Follow the very short instructions of <a href="https://github.com/TwP/logging-rails" rel="nofollow">logging-rails</a> to get started filtering out noise, getting alerts, and choosing output in a fine-grained and high-l...
43,829
<p>We have created a control that needs to persist data via the ViewState property of the Control class. Our class subclasses control strictly to get access to the ViewState property (it's protected on the Page object). We are adding the control to Page.Controls in OnInit, and then attempt to set the ViewState property...
<p>The issue is adding the control to the Page directly. Unfortunately this is too high up the controls hierarchy to participate in the Forms ViewState Handling. If you add the control onto the actual ASPNet Form's Controls collection somewhere then it will successfully participate in LoadViewStateRecursive and SaveVie...
<p>Try creating your control in OnInit, then add it to the Page.Controls during OnLoad.</p>
15,872
<p>I'm reading ScottGu's blog about ASP.NET MVC, and found a lot of code cannot compile or doesn't work as expected. </p> <p><a href="http://weblogs.asp.net/scottgu/archive/2007/11/13/asp-net-mvc-framework-part-1.aspx" rel="nofollow noreferrer">http://weblogs.asp.net/scottgu/archive/2007/11/13/asp-net-mvc-framework-pa...
<p>That code is based on asp.net mvc 1.0 Preview2. Version 1 has been released, and Version 2 is currently in beta. Check out the samples at <a href="http://asp.net/mvc" rel="nofollow noreferrer">http://asp.net/mvc</a> to get updated samples</p>
<p>Take a look here:</p> <p><a href="http://www.asp.net/mvc/" rel="nofollow noreferrer">http://www.asp.net/mvc/</a></p> <p>It HAS changed a lot, it was presented as a new beta version on PDC in LA in October...</p>
43,638
<p>We're working on an hospital information system that is being written on C# and using NHibernate to map objects to database. MVC pattern is being used to separate business logic from UI. Here is the problem,</p> <p>How do you get variable sized different set of strings to UI?</p> <p>For example a <code>Contact</co...
<p>I would vote for solution #4. That's the way I have always done it in similar situations. It just seems like a cleaner solution.</p>
<p>How do you feel of using List&lt;string&gt; for a list of City? Load this list of strings in your DAL or BL and then pass it on to UI.</p> <p>Same solution should be good for FooBar values too.</p> <p>In case you have IDs associated with City or FooBar, say NY and its numeric ID in DB is 1, then you can use KeyVal...
26,860
<p>How do I hide/lock a few tables in Oracle so that only my application has access to modify those data in the table?</p>
<p>Create a user/login to the DB that you can control. Assign that user as the owner (using grants) of the tables you need to "hide/lock". Use grants to make the tables inaccessible ( or read only) to other users.</p>
<p>After creating the user, make sure you remove the grants for other users. By default, default users have the grant. So make sure only your user has all the the grants</p>
44,593
<p>Is it possible to use an <a href="http://en.wikipedia.org/wiki/ASP.NET" rel="noreferrer">ASP.NET</a> web.sitemap with a jQuery <a href="http://users.tpg.com.au/j_birch/plugins/superfish/" rel="noreferrer">Superfish</a> menu? </p> <p>If not, are there any standards based browser agnostic plugins available that work...
<p>I found this question while looking for the same answer... everyone <em>says</em> it's possible but no-one gives the actual solution! I seem to have it working now so thought I'd post my findings...</p> <p>Things I needed:</p> <ul> <li><p><a href="http://users.tpg.com.au/j_birch/plugins/superfish/#download" rel="n...
<p>The SiteMapDataSource control should be able to bind to any hierarchical data bound control. I'm not familiar with superfish but I know there are plenty of jQueryish controls out there to do this.</p>
12,929