instruction stringlengths 21 27.8k | chosen stringlengths 18 28.2k | rejected stringlengths 18 33.6k | __index_level_0__ int64 0 50k |
|---|---|---|---|
<p>I am calling 4-5 scripts from a file at once.
But I need to give only one input to the file in the first sql that I am calling.</p>
<p>That input will be the input for all the other sql files I have called after the first one.</p>
<p>Is there any way to do that?</p>
<p>please help.</p>
| <p>I think you can achieve what you want by using the <a href="http://msdn.microsoft.com/en-us/library/ms162773.aspx" rel="nofollow noreferrer">sqlcmd</a> utility and <a href="http://msdn.microsoft.com/en-us/library/ms188714.aspx" rel="nofollow noreferrer">scripting variables</a>. The last link states that you can also... | <p>Do you mean:</p>
<p>query2 is based on the result of query1,
query3 is based on the result of query2 etc...</p>
<p>If so, you can use views to </p>
<pre><code>create view view1 as select * from table1;
create view view2 as select * from view2;
create view view3 as select * from view3;
create view view4 as select ... | 47,333 |
<p>In a MVC application, what are some of the components that make up the application. What tools and functionality is missing that you would like to have. Regardless of the server-side language, what would you want?</p>
<p>I see a lot in my code where I code some much functionality that it seems should already be t... | <p>Built-in Unit Testing Component </p>
| <p>I think one thing you're missing from that very exhaustive list is the automatic binding of request properties to form objects, and the saving of these objects to the session where appropriate. Form objects here being the object on the server that represents the current state of the HTML-based for displayed to the ... | 29,136 |
<p>Can anyone tell me how to write a nested SQL query like </p>
<p>SELECT * FROM X WHERE X.ID IN (SELECT Y.XID FROM Y WHERE .....)</p>
<p>in LINQ?</p>
| <p>You could try:</p>
<pre><code>var yIds = from y in dataContext.Y
where ...
select y.XId;
var query = from x in dataContext.X
where yIds.Contains(x.Id)
select x;
</code></pre>
<p>I don't know whether it will work though - any reason why you don't want to just do a join... | <p>To do an IN in sql, you need to use the Contains function in Linq.</p>
<p>So for example:</p>
<pre><code>var query = from x in GetX()
where (from y in GetY() select y.xID).Contains(x.xID)
select x;
</code></pre>
<p>You could also define the inner linq query seperately if you like, which is... | 48,010 |
<p>I'm looking to have windows recognize that certain folders are associated to my application - maybe by naming the folder 'folder.myExt'.</p>
<p>Can this be done via the registry?</p>
<p>A bit more info<br>
- This is for a x-platform app ( that's why I suggested the folder with an extension - mac can handle that ) ... | <p>Folders in Windows aren't subject to the name.extension rules at all, there's only 1 entry in the registry's file type handling for "folder" types. (If you try to change it you're going to have very, very rough times ahead)</p>
<p>The only simple way to get the effect you're after would be to do what OpenOffice, MS... | <p>You can have an "extension" on your folder, but as far as I know, windows just treats it all as the folder name and opens the folder like normal when you click on it.</p>
<p>The few times I messed with opening a .app on my windows system, it acted like it was a normal folder.</p>
| 9,353 |
<p>I need to write a Stored procedure in SQL server whose data returned will be used to generate a XML file.</p>
<p>My XML file to be in structure of </p>
<pre><code><root>
<ANode></ANode>
<BNode></BNode>
<CNode>
<C1Node>
<C11Node></C11Node>
<C12Node&... | <p>See</p>
<p> <a href="https://stackoverflow.com/questions/147897/in-sql-server-can-i-insert-multiple-nodes-into-xml-from-a-table#148877">Nesting XML-returning scalar valued functions</a> </p>
<p>Once you get the hang of the nesting, and are willing to write the number of scalar-valued functions necessa... | <p>If you are able to modify the database design, consider keeping each node as a record, instead of as a column (as the sample select statement would indicate).</p>
<p>For example, each row might include the following fields:</p>
<ul>
<li>RowId</li>
<li>ParentRowId</li>
<li>Name</li>
<li>RowData</li>
</ul>
<p>I'm a... | 34,076 |
<p>I'm struggling with Visual Studio 2008. I've used some form of "Zen" colors for more than I can remember. In VS2008 I keep getting one color that I cannot read and I have been unable to identify it; the purpose of the question is to avoid trial an error (the VS color interface is really ugly with no "real time" appl... | <p>This describes the meaning of all those color options.</p>
<p>I think the one you are looking for is "Call Return"</p>
<p><a href="http://msdn.microsoft.com/en-us/library/kw7t0545.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/kw7t0545.aspx</a></p>
| <p>I think that's your Call Return, under Text Editor.</p>
| 28,497 |
<p>I'm trying to use NAnt/NAntContrib build script to build a web application on Windows 2008 (IIS 7.0).</p>
<p>In the build file, there is mkiisdir task, which fails with:</p>
<p>[mkiisdir] The webservice at 'localhost' does not exist or is not reachable.</p>
<p>All the documents/posts I found so far (non for w2k8,... | <p>To answer my own question - I have isolated the part of the code in NantContrib which was causing the problem, and made a sample application to test.</p>
<p>I have posted this as a separate question <a href="https://stackoverflow.com/questions/263552/directoryentrynativeobject-throws-access-denied-for-a-user-in-adm... | <p>In order to get iis nantcontrib tasks to work you need to install IIS6 Management Compatibility Tools. Here is the blog describing how to do it in Vista:</p>
<p><a href="http://thoughtworker.in/2008/01/15/nant-the-webservice-at-localhost-does-not-exist-or-is-not-reachable/" rel="nofollow noreferrer">http://thoughtw... | 32,573 |
<p>Wnen I use external resources such as files or DB connection I need to close them before I let them go.</p>
<p>Do I need to do the same thing with Swing components ? If yes then how ?</p>
| <p>Normally, you don't need to dispose of objects when you are done with them (although setting the references to them to null may allow them to be GCed sooner). However, AWT and Swing objects allocate some amount of native resources that need to be freed. Furthermore, the AWT thread treats the windows as top-level o... | <p>Objects are automatically garbage collected if there are no references to them. You do not have to treat Swing components the same way that you do external resources. However, if you have a component that you are not going to need later you can set any references to that component to null.</p>
<pre><code>JPanel p =... | 41,488 |
<p>I am using JSF frontend for a page where an image is uploaded or deleted. Clicking on the upload or delete button causes a postback and the page to reload with the updated status. This however, resets the scroll position of the page. How should I go about retaining the scrollback of this page on the postback actions... | <p>You can do that with an actionListener. For example, in your page (page.jsf for example):</p>
<pre><code><f:view>
<h:form>
<h:commandLink actionListener="#{bean.method}">
<h:outputText value="Submit" />
<f:param name="anchor" value="image" />
... | <p>If you are using Apache MyFaces Tomahawk, you can set the parameter AUTOSCROLL then make sure AutoScrollPhaseListener is enabled.</p>
<p>I'm not sure this functionality is specified by JSF, but instead is something extra implemented by Apache MyFaces Tomahawk.</p>
<p>Also, be aware that prior to version 1.1.6, the... | 30,776 |
<p>I am doing some research on Unicode for a white-paper I am writing. Does anyone remember the first version of MS Office on the Windows platform that was fully Unicode compliant? Not having much luck Googling this answer out of the net.</p>
| <p>office 97:
<br/>
"The universal character set provided by Unicode overcomes this problem. Office 97 was the first version of Office to support Unicode in all applications except Microsoft Access and Microsoft Outlook®. In Office 2000, Access and Microsoft Publisher gain Unicode support. Microsoft FrontPage® 2000 als... | <p>Further to DanWoolston's answer, Microsoft Outlook 2003 was the first Outlook version to offer full Unicode support, so depending on your definition of 'Office' (seeing as there are so many different editions), your answer might be Microsoft Office 2003.</p>
<p>URL: <a href="http://office.microsoft.com/en-us/ork200... | 13,029 |
<p>Running IIS5 (yes, really). I'd like to remove the eTag http header that IIS generates for me. MS has an article on how to sync eTags across the web farm, but not how to remove them ( <a href="http://support.microsoft.com/?id=922733" rel="nofollow noreferrer">http://support.microsoft.com/?id=922733</a> ). </p>
<... | <p>AFAIK, there's no easy way to remove etag of web resources such as image, css or js files from IIS 5. As each of the etag value regenerates on each subsequent web browser refresh which is unnecessary since there might not be any changes on those web resources.</p>
<p>You might want to try EtagFix, it doesn't remove... | <p>Go into Inetmgr and in the website properties, switch to the HTTP Headers tab and add an "ETag" custom HTTP header with no value.</p>
| 34,682 |
<p>I want to sort members by name in the source code. Is there any easy way to do it? </p>
<p>I'm using NetBeans, but if there is another editor that can do that, just tell me the name of it.</p>
| <p>In Netbeans 8.0.1:</p>
<pre><code>Tools -> Options -> Editor -> Formatting -> Category: Ordering
</code></pre>
<p><img src="https://i.stack.imgur.com/7BxRT.png" alt="Netbeans member sorting"></p>
<p>Then:</p>
<pre><code>Source -> Organize Members
</code></pre>
<p><img src="https://i.stack.imgur.c... | <p>Here is the easy way to do it in NetBeans:</p>
<ol>
<li>Go to the Tools tab and chose Options.
The option Window should appear.</li>
<li>Click on Editor and chose the Formatting Tab. </li>
<li>Select Ordering for Category.
Ordering is the last element from the drop down Category list.</li>
<li>Uncheck the Sort Me... | 26,703 |
<p>I am wondering what are the possible value for *_la_LDFLAGS in Makefile.am ? </p>
<p>If I ask this question, it is because I would like the following :</p>
<pre><code>Actual shared library : libA.so (or with the version number I don't care)
Symbolic links : libA-X.Y.Z.so, libA-X.so, libA.so
soname : ... | <p>You should use the <code>-version-info</code> option of Libtool to specify the interface version of the library, but be sure to read
<a href="http://sources.redhat.com/autobook/autobook/autobook_91.html" rel="nofollow noreferrer">how versioning works</a> (or <a href="http://www.gnu.org/software/libtool/manual/html_... | <p>IMHO, the layout you want is broken. Apps that are linked to your library will depend on libA-X.so because of the soname. But what happens when libA.so is version X+1? To what will the libA-X.so symlink point?</p>
<p>The idea behind the layout you get with the -release flag is, when an app links with -lA, it will r... | 31,691 |
<p>What is your preferred method of traversing a tree data structure, since recursive method calls can be pretty inefficient in some circumstances. I am simply using a generator like the one above. Do you have any hints to make it faster?</p>
<pre><code>def children(self):
stack = [self.entities]
while stack: ... | <p>I can't think of any big algorithmic improvements, but a simple microoptimisation you can make is to bind frequently called methods (such as stack.append / stack.pop) to locals (this saves a dictionary lookup)</p>
<pre><code>def children(self):
stack = [self.entities]
push = stack.append
pop = stack.pop... | <p>I don't know too much about Python internals of function calls, but I really can't imagine that your code snippet is faster than recursively traversing the tree.</p>
<p>The call stack (used for function calls, including recursive ones) is typically very fast. Going to the next object will only cost you a single fun... | 41,393 |
<p>I'm trying to do a subselect in pgsql aka postgresql and the example I found doesn't work:</p>
<pre><code>SELECT id FROM (SELECT * FROM table);
</code></pre>
| <p>I just needed to add an AS for the subselect, like so:</p>
<pre><code>SELECT id FROM (SELECT * FROM table) AS aliasname;
</code></pre>
| <p>I think you need something like:</p>
<pre><code>SELECT * FROM table WHERE id IN (SELECT id FROM table2);
</code></pre>
<p>I don't understand what your non-working subquery is attempting to do, it seems like you could just say <code>SELECT id FROM table</code> because presently its not valid SQL92 syntax.</p>
| 33,771 |
<p>I am trying to inherit from my generated datacontext in LinqToSQL - something like this </p>
<pre><code>public class myContext : dbDataContext {
public System.Data.Linq.Table<User>() Users {
return (from x in base.Users() where x.DeletedOn.HasValue == false select x);
}
}
</code></pre>
<p>But my Linq sta... | <p>Another approach would to be use views..</p>
<pre><code>CREATE VIEW ActiveUsers as SELECT * FROM Users WHERE IsDeleted = 0
</code></pre>
<p>As far as linq to sql is concerned, that is just the same as a table. For any table that you needed the DeletedOn filtering, just create a view that uses the filter and use t... | <p>You can use a stored procedure that returns all the mapped columns in the table for all the records that are not marked deleted, then map the LINQ to SQL class to the stored procedure's results. I think you just drag-drop the stored proc in Server Explorer on to the class in the LINQ to SQL designer.</p>
| 11,100 |
<p>I'm having trouble finding an open-source IDE with support for Git. Are there any that you could point me to or recommend?</p>
| <p>There's an <a href="http://www.eclipse.org/egit/" rel="nofollow noreferrer">Eclipse plugin in progress</a>.</p>
| <p>The great <a href="http://www.aptana.com/studio" rel="nofollow noreferrer">Aptana Studio</a> has support (via plugins) for SVN, CVS, and Git (via <a href="http://git.or.cz/gitwiki/EclipsePlugin" rel="nofollow noreferrer">this plugin</a>). I'm still a noob with Aptana, and I haven't used Git yet, but it looks promis... | 46,069 |
<p>The last GUI programming I have done was with Visual Basic, which included objects like Winsock and Inet to easily connect to the internet and retrieve the source from webpages.</p>
<p>I just got started into XCode, and was wondering if there is a similar component. I see that there is a Webkit option in the Librar... | <p>Apple has two guides in the documentation you'll want to look at, <a href="http://developer.apple.com/documentation/Cocoa/Conceptual/URLLoadingSystem/URLLoadingSystem.html" rel="nofollow noreferrer">URL Loading System</a> and <a href="http://developer.apple.com/DOCUMENTATION/Cocoa/Conceptual/DisplayWebContent/Displa... | <p>The NSString class have methods to retrieve source from webpages, such as stringWithContentsOfURL:encoding:error:.</p>
<p>For more control, take a look at the classes described in <a href="http://developer.apple.com/documentation/Cocoa/Conceptual/URLLoadingSystem/URLLoadingSystem.html" rel="nofollow noreferrer">htt... | 49,310 |
<p>Any suggestions on how to improve DataGridViewComboBoxColumn performace with large item sets?</p>
<p>I've got a DataGridView with several columns of type DataGridViewComboBoxColumn. I'm databinding those combobox columns to a rather large collection (10k+ items). As a result it's very slow to display the items (whe... | <p>A much better solution is to populate a string array with the values from the database and set the column datasource to null, then set the Items property of the column to the array of values you populated. This way it does not requery the database each time it populates the combobox. Hope this helps.</p>
| <p>Are you data binding 10k items to the combo boxes or the data grid? </p>
<p>Either way you should think about the usability of your design. </p>
<p>If its to the data grid then use paging and cut the size of the data source bound to a more reasonable size. </p>
<p>If its to the combo box then your solution can't... | 33,620 |
<p>I have a bit of code that passes around a ton of objects and I want to determine if there are any references still lingering around that I am unaware of and where it is those references are located. Any idea of how I can do this? </p>
<p>My understanding is that the watch window only allows me to see items availabl... | <p>if you are talking in the code, just right click on the object name, in the drop down menu pick "Find all references", the list of references will appear below in the output window</p>
<p>EDIT: Since there was only a .NET tag, Visual Studio assumed</p>
| <p>In a IDE like Elcipse or Visual Studio you can do it with the context menu.</p>
| 16,350 |
<p>I have wrapped Log4net in a static wrapper and want to log </p>
<pre><code>loggingEvent.LocationInformation.MethodName
loggingEvent.LocationInformation.ClassName
</code></pre>
<p>However all I get is the name of my wrapper.</p>
<p>How can I log that info using a forwardingappender and a static wrapper class li... | <p>Well the error was somewhere in my appender but for completeness ill include the answer to the best of my knowledge:</p>
<p>the Facade you need should wrap ILogger and NOT ILog</p>
<pre><code> public static class Logger
{
private readonly static Type ThisDeclaringType = typeof(Logger);
private static read... | <p>The only thing I can think of doing (as I dont currently use log4net) is to request a stacktrace(new StackTrace), and go back a frame to get the info you need. However, I am unsure of the runtime performance impact of this.</p>
| 19,025 |
<p>I am currently defining regular expressions in order to capture parameters in a URL, as described in the tutorial. How do I access parameters from the URL as part the <code>HttpRequest</code> object?</p>
<p>My <code>HttpRequest.GET</code> currently returns an empty <code>QueryDict</code> object.</p>
<p>I'd like to l... | <p>When a URL is like <code>domain/search/?q=haha</code>, you would use <code>request.GET.get('q', '')</code>.</p>
<p><code>q</code> is the parameter you want, and <code>''</code> is the default value if <code>q</code> isn't found.</p>
<p>However, if you are instead just configuring your <code>URLconf</code>**, then yo... | <p>url parameters may be captured by <code>request.query_params</code></p>
| 18,138 |
<p>I have a website built in PHP 4 with a framework made by hand by me. The code is 3 years old and I am limited (well it requires a lot of effort to make changes).</p>
<p>I decided to do new version of this website. My knowledge has since increased, and now I know that a lot of frameworks exist and that <strong>IOC</s... | <p>If you made the whole framework yourself, I would suggest you just upgrade it for PHP 5 and go forward from there. Most PHP 4 code will "just work" in PHP 5; the exceptions are code that uses the new reserved words, and code that relies on the way PHP 4 differs from PHP 5 -- which means a few things in classes and r... | <p>And why are you limiting yourself to these choices? Why not try Ruby on Rails? I has a built-in ORM!</p>
| 32,149 |
<p>How do I create tabbed navigation with the "Current" tab highlighted in the UI?</p>
| <p>Before MVC I looked at the file path and figured out which tab was currrent. Now it's a lot easier, you can assign the current tab based on the current controller.</p>
<p>Check it out ...</p>
<p>Most of the work happens in the usercontrol. </p>
<pre><code>public partial class AdminNavigation : ViewUserControl
{
... | <p>MVC's default <code>Site.css</code> comes with a class named <code>'selectedLink'</code> which should be used for this.</p>
<p>Add the following to your <code>ul</code> list in <code>_Layout.cshtml</code>:</p>
<pre><code>@{
var controller = @HttpContext.Current.Request.RequestContext.RouteData.Values["controll... | 36,604 |
<p>Why would someone use <code>WHERE 1=1 AND <conditions></code> in a SQL clause (Either SQL obtained through concatenated strings, either view definition)</p>
<p>I've seen somewhere that this would be used to protect against SQL Injection, but it seems very weird.</p>
<p>If there is injection <code>WHERE 1 = 1... | <p>If the list of conditions is not known at compile time and is instead built at run time, you don't have to worry about whether you have one or more than one condition. You can generate them all like:</p>
<pre><code>and <condition>
</code></pre>
<p>and concatenate them all together. With the <code>1=1</code> ... | <p>I first came across this back with ADO and classic asp, the answer i got was: <strong>performance.</strong>
if you do a straight </p>
<p><code>Select * from tablename</code></p>
<p>and pass that in as an sql command/text you will get a noticeable performance increase with the </p>
<p><code>Where 1=1</code></p>
<... | 30,072 |
<p>I don't need a Link but rather only the href= part of the ActionLink.</p>
<p>But if I call Html.ActionLink(...) I get a back.
Is there a way to just return the URL of the Action while not getting the ?</p>
| <p>MVC also provides a UrlHelper class which can do the same thing:</p>
<pre><code><%=Url.Action(actionName)%>
<%=Url.Action(actionName, htmlValues)%>
<%=Url.Action(actionName, controllerName, htmlValues)%>
</code></pre>
| <p>Edit: in response to commment, now including parameters:</p>
<pre><code><% =Html.BuildUrlFromExpression<YourController>(c => c.YourAction(parameter)) %>
</code></pre>
| 18,351 |
<p>Is there a way to just tell the compiler, that I want my objects to be serializable by default?</p>
| <p>Pretty much every serialization engine is going to want to know that your objects are suitable. This can take the form of:</p>
<ul>
<li><code>[Serializable]</code>/<code>ISerializable</code> (<code>BinaryFormatter</code>,<code>SoapFormatter</code>)</li>
<li><code>[Serializable]</code>/<code>IXmlSerializable</code> ... | <p>No, you need to decorate the objects with the Serializable attribute. FYI all objects are Xml Serializable by default. The Xml Serializer doesn't require the attribute.</p>
<p>I'm not sure about DataContracts but last I checked you needed to decorate them as well. </p>
| 44,266 |
<p>Anyone found a good pattern for getting around immutable styles in Silverlight 2? <br/><br/>What I mean is does anyone have a workaround for the fact that you cannot switch the style of an element programmatically once it has been set, i.e. the second line here will throw a catastrophic failure exception:</p>
<p>th... | <p>It's not possible. The best workaround I've seen is from Nikhil Kothari at Microsoft:</p>
<p><a href="http://www.nikhilk.net/Silverlight-Themes.aspx" rel="nofollow noreferrer">http://www.nikhilk.net/Silverlight-Themes.aspx</a></p>
<p>There is a major drawback to defining styles centrally in App.xaml anyway, which... | <p>I don't know if this helps, but I believe you can change the control's template as many times as you want during runtime. Maybe that would be a potential workaround.</p>
| 15,413 |
<p>I would like to know how to loop through each line in a text file using a Windows batch file and process each line of text in succession.</p>
| <p>I needed to process the entire line as a whole. Here is what I found to work.</p>
<pre><code>for /F "tokens=*" %%A in (myfile.txt) do [process] %%A
</code></pre>
<p>The tokens keyword with an asterisk (*) will pull all text for the entire line. If you don't put in the asterisk it will only pull the first... | <p>Modded examples here to list our Rails apps on Heroku - thanks!</p>
<pre><code>cmd /C "heroku list > heroku_apps.txt"
find /v "=" heroku_apps.txt | find /v ".TXT" | findstr /r /v /c:"^$" > heroku_apps_list.txt
for /F "tokens=1" %%i in (heroku_apps_list.txt) do heroku run bundle show rails --app %%i
</code></p... | 18,865 |
<p>I have a large set of data (a data cube of 250,000 X 1,000 doubles, about a 4 gig file) and I want to manipulate it using a previous set of OOP classes I have written in Python. Currently the data set is already so large that to read into my machine memory I have to at least split it in half so computing overhead i... | <p>See <a href="http://code.activestate.com/recipes/546530/" rel="nofollow noreferrer">http://code.activestate.com/recipes/546530/</a></p>
<p>This is the approximate size of Python objects.</p>
<p>The OO size "penalty" is often offset by the ability to (a) simplify processing and (b) keep less stuff in memory in the ... | <p>Impossible to answer without knowing the shape of the data and the structure that you've designed to contain it.</p>
| 48,695 |
<p>Let's say that I want to have a table that logs the date and the number of columns in some other table (or really any sort of math / string concat etc).</p>
<pre><code>CREATE TABLE `log` (
`id` INTEGER NOT NULL AUTO_INCREMENT ,
`date` DATETIME NOT NULL ,
`count` INTEGER NOT NULL ,
PRIMARY KEY (`id`)
);
</code></pre... | <p>Triggers are the best tool for annotating data when a table is changed by insert, update or delete.</p>
<p>To automatically set the date column of a new row in the log with the current date, you'd create a trigger that looked something like this:</p>
<pre><code>create trigger log_date before insert on log
for eac... | <p>Why don't you use information_schema.TABLES?</p>
| 6,722 |
<p>I can start with my own .NET dll. I have a dll I use in all my web projects (around 10) and I have util classes for FTP, zip, imageresizing, extensionmethods and a generic singleton class.</p>
<p>I think it is a common practice and I just thought it would be interesting to hear what people put in their 'Utils' dlls... | <p>I think carrying utility assemblies beyond the current version of your language does more harm than good.</p>
<p>The main reason is that as the language grows new methods and better ways of doing things are built in. By carrying around a utilities assembly, you will quickly end up with a lot of dead weight which m... | <p>I have only just really started mine but at the moment it mostly contains just common extension methods that I use all the time. Stuff like "ThrowIfNull()" so I don't have to do heaps of if statements every time I want to check for nulls.</p>
<p>I also have a playground project which just has any ideas that I am to... | 41,287 |
<p>I have an ASP.Net 2.0 application in which the Session_Start event is not firing in my Global.asax file. Can anyone tell why this is happening and how I can get it working?</p>
<p>The application worked fine on my Windows XP development machine, but stopped working when deployed to the server (Win Server 2003/IIS 6... | <p>Is the site precompiled before adding global.asax? Try compiling it again.</p>
| <p>Are you sure the website in IIS is set to use ASP.NET 2.0 rather than 1.1?</p>
| 9,719 |
<p>I have a text file which contains some data. I am trying to search for EA in <strong>ID column only</strong> and prints the whole row. But the code recognize all EA and prints all rows. What code I should add to satisfy the condition? Thanks Again:-)!</p>
<p>DATA: <br>
Name Age ID <br>
---------------------<br>
... | <p>You should post the actual sample program you are using to illustrate the problem. Here's your cleansed program:</p>
<pre><code>use strict;
use warnings;
use CGI;
my $EA = param('keyword');
my $file = 'save.txt';
open my $fh, "<", $file or die "Could not open $file: $!";
while( $line=<$fh> ) {
if( $... | <p>Your regex is incorrect for what you are trying to do. Ben's solution works, although there should also be a ^ at the start, which ensures that the regex will start matching from the start of the string:</p>
<p>/^.<em>?,.</em>?,.*EA/</p>
<p>Also, your code is kinda noisy, from a perl point of view. If you want t... | 32,626 |
<p>We all know that prepared statements are one of the best way of fending of SQL injection attacks. What is the best way of creating a prepared statement with an "IN" clause. Is there an easy way to do this with an unspecified number of values? Take the following query for example.</p>
<pre><code>SELECT ID,Column1... | <p>Here you go - first create the following function...</p>
<pre><code>Create Function [dbo].[SeparateValues]
(
@data VARCHAR(MAX),
@delimiter VARCHAR(10)
)
RETURNS @tbldata TABLE(col VARCHAR(10))
As
Begin
DECLARE @pos INT
DECLARE @prevpos INT
SET @pos = 1
SET @prevpos = 0
WHILE @p... | <p>In SQL Server 2008, they finally got around to addressing this classic problem by adding a new "table" datatype. Apparently, that lets you pass in an array of values, which can be used in a sub-select to accomplish the same as an IN statement.</p>
<p>If you're using SQL Server 2008, then you might look into that.</... | 11,860 |
<p>Does anyone know how to use the <a href="http://msdn.microsoft.com/en-us/library/ms645543(VS.85).aspx" rel="nofollow noreferrer">Raw Input</a> facility on Windows from a WX Python application?</p>
<p>What I need to do is be able to differentiate the input from multiple keyboards. So if there is another way to achie... | <p>Have you tried using ctypes?</p>
<pre><code>>>> import ctypes
>>> ctypes.windll.user32.RegisterRawInputDevices
<_FuncPtr object at 0x01FCFDC8>
</code></pre>
<p>It would be a little work setting up the Python version of the necessary structures, but you may be able to query the Win32 API dir... | <p>Theres a nice looking library here
<a href="http://code.google.com/p/pymultimouse/" rel="nofollow noreferrer">http://code.google.com/p/pymultimouse/</a></p>
<p>It's not wx-python specific - but it does use raw input in python with ctypes (and worked in my test with 2 mice)</p>
| 36,313 |
<p>It seems that all of the documentation I can find about OpenGL-ES says something to the effect of "OpenGL-ES is just like OpenGL, but without a lot of stuff. For example, there's no glBegin or glEnd."</p>
<p>Ok, that's great. So, what ELSE isn't there any of? Or is there a list of what's <em>in</em>? Or maybe a... | <p>The <a href="http://www.khronos.org/registry/gles/specs/1.1/es_cm_spec_1.1.12.pdf" rel="noreferrer">"OpenGL ES 1.1.12 Difference Specification"</a> (PDF) linked to from <a href="http://www.khronos.org/opengles/1_X/" rel="noreferrer">the OpenGL ES 1.X info page at Khronos.org</a> goes through the differences between ... | <p>Part of the problem in answering your question is there are many things missing and often it's a set of rarely used or non-applicable bit flags. The best document describing the differences is actually the implementation headers.</p>
<p>For the framework I'm working on I decided to make it completely cross platform... | 34,375 |
<p>Someone left the organisation but before leaving, he locked all the files for an unknown reason. </p>
<p>How do you unlock them all so that the other developers can work?</p>
| <p>For the following operation, you will need to be either a project administrator for the project you want to undo the check-in on or a Team Foundation Administrator if you want to do this across all projects.</p>
<p>If you still have the username of the person, you can simply do something like this:</p>
<ul>
<li>Op... | <p><strong>Use this solution as the very last resort</strong>.</p>
<p>I’m using TFS 2012. I went to the TFS database and ran the following queries. And it worked! <strong>Of course be very careful when messing with the database, take backups, etc.</strong></p>
<p>The database is called <em>Tfs_<<your_TFS_collec... | 33,750 |
<p>Due to current limitations on getting DIV tags to work well across browser platforms for the particular liquid layout I desire, I have opted to use a combination of Tables and DIVs for layout. That being said, a couple of issues remain. </p>
<p>The FIRST issue is that in Firefox, my table row height for my footer... | <p>I know this is quite unrelated, but I recommend that you use <a href="http://validator.w3.org/#validate_by_input" rel="nofollow noreferrer">the w3c validator</a> to validate your HTML once in a while.</p>
| <p>A couple suggestions: </p>
<p>Add a doctype - if use use the right one you can get IE to standards mode rather than quirks mode <a href="http://www.quirksmode.org/css/quirksmode.html" rel="nofollow noreferrer">http://www.quirksmode.org/css/quirksmode.html</a>, so behaviour will be more consistent between IE and o... | 41,220 |
<p>If I have Python code</p>
<pre><code>class A():
pass
class B():
pass
class C(A, B):
pass
</code></pre>
<p>and I have class <code>C</code>, is there a way to iterate through it's super classed (<code>A</code> and <code>B</code>)? Something like pseudocode:</p>
<pre><code>>>> magicGetSuperClass... | <p><code>C.__bases__</code> is an array of the super classes, so you could implement your hypothetical function like so:</p>
<pre><code>def magicGetSuperClasses(cls):
return cls.__bases__
</code></pre>
<p>But I imagine it would be easier to just reference <code>cls.__bases__</code> directly in most cases.</p>
| <p>The inspect module was a good start, use the <a href="http://docs.python.org/library/inspect.html#inspect.getmro" rel="nofollow noreferrer">getmro</a> function:</p>
<blockquote>
<p>Return a tuple of class cls’s base classes, including cls, in method resolution order. No class appears more than once in this tuple.... | 4,541 |
<p>I'm having major rendering issues in Safari with the web application I'm working on. Most of the design is done with divs using absolute positioning. This renders fine on Internet Explorer, Firefox, Chrome, Opera, Netscape, and konqueror. In Safari, it's just a jumbled mess. </p>
<p>Does Safari lack support for... | <p>The <code>readonly</code> keyword is used to declare a member variable a constant, but allows the value to be calculated at runtime. This differs from a constant declared with the <code>const</code> modifier, which must have its value set at compile time. Using <code>readonly</code> you can set the value of the fi... | <p>There can be a performance benefit in WPF, as it removes the need for expensive DependencyProperties. This can be especially useful with collections</p>
| 34,947 |
<p>The company I just started working for is using <a href="http://www.stripesframework.org/display/stripes/Home" rel="noreferrer">Stripes</a> for parts of its web page development these days, and while it seems to be a nice enough web framework it no one really uses it-- it is almost non existent on the 'net. It's not... | <p>I've never used (or even heard of) Stripes.</p>
<p>Regardless, there's a book from <a href="http://www.pragprog.com/" rel="nofollow noreferrer">The Pragmatic Bookshelf</a> called <a href="http://www.pragprog.com/titles/fdstr/stripes" rel="nofollow noreferrer">Stripes: ...and Java web development is fun again</a> th... | <p>We considered it when we were looking at open source frameworks. But we saw the same thing your did that there really just isn't much support or information for it. You should always weight the community support factor surrounding open source projects before picking one. (which is what you are doing here)</p>
| 3,649 |
<p>Can anyone point me to a tutorial on the best way to open a connection from client to server, read in a binary file and send its contents reliably across the network connection? Even better, is there an open source library that already does this that I could refer to? </p>
| <p>You should look into binary serialization and sending it over a TCP socket.</p>
<p>Good explanation on different types of serialization:</p>
<p><a href="http://www.dotnetspider.com/resources/408-XML-serialization-Binary-serialization.aspx" rel="noreferrer">http://www.dotnetspider.com/resources/408-XML-serializatio... | <p>How about using HTTP or FTP? They were sort of made for this.</p>
<p>Alex</p>
| 12,086 |
<p>I haven't programmed games for about 10 years (My last experience was DJGPP + Allegro), but I thought I'd check out XNA over the weekend to see how it was shaping up.</p>
<p>I am fairly impressed, however as I continue to piece together a game engine, I have a (probably) basic question.</p>
<p>How much should you ... | <p>If you were to think of an event as a subscriber list, in your code all you are doing is registering a subscriber. The number of instructions needed to achieve that is likely to be minimal at the CLR level.</p>
<p>If you want your code to be generic or dynamic, then you're need to check if something is subscribed ... | <p>XNA encourages the use of interfaces, events and delegates to drive something written with it. Take a look at the GameComponent related classes which set this up for you.</p>
<p>The answer is, "As much as you feel comfortable with".</p>
<p>To elaborate a little bit, If for example you take and inherit from the gam... | 8,942 |
<p>It took me 2 days (and a lot of head/wall pounding) to finally discover that the reason ad-hoc distribution wasn't working for me was because my app-name had UTF-8 characters. I'm still boggling over how such a widely international platform like the Apple iPhone can prohibit this.</p>
<p><em>i.e.</em>, if my app w... | <p>Turns out (according to DTS), it's a bug in the way iTunes handles ad-hoc distribution. This problem is specific to ad-hoc -- my developer distribution works fine, and I'm told the app-store will handle it fine, too -- it's just ad-hoc distribution (the common mechanism for things like beta-testing.)</p>
<p>In par... | <p>OSX in general supports UTF8 natively, throughout Cocoa to the Filesystem.</p>
<p>An example in 日本語:
<a href="http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=294753911&mt=8" rel="nofollow noreferrer">http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=294753911&mt=8</a></p>
... | 33,417 |
<p>Visual Studio includes support for __forceinline. The Microsoft Visual Studio 2005 documentation states:</p>
<blockquote>
<p>The __forceinline keyword overrides
the cost/benefit analysis and relies
on the judgment of the programmer
instead.</p>
</blockquote>
<p>This raises the question: When is the compil... | <p>You know better than the compiler only when your profiling data tells you so.</p>
| <p>There are several situations where the compiler is not able to determine categorically whether it is appropriate or beneficial to inline a function. Inlining may involve trade-off's that the compiler is unwilling to make, but you are (e.g,, code bloat).</p>
<p>In general, modern compilers are actually pretty good a... | 18,313 |
<p>We are developing a desktop application(visual basic 6.0).We have our own logging framework. What are good practices? When we have a web application, then we can control the level of logging. How to go about in a desktop app?</p>
| <p>Any answer needs to be considered based on your environment:</p>
<ul>
<li>Do your business rules (or laws) <em>require</em> certain activities to be logged?</li>
<li>Is security an issue?</li>
<li>Do actions need to be traceable?</li>
<li>Is the size of the log file (or the amount of disk space) an issue?</li>
<li>... | <p>An important feature to consider is to allow for adjustment of the log level dynamically at run time without requiring stopping and restarting the application (I've implemented this on *nix with a custom signal handler). This is a great help when debugging in the field. </p>
<p>Many times, a misbehaving application... | 31,470 |
<p>The situation: We're out of beta and version 1.0 has been released to several customer sites. Team A is already busy working on version 1.1 that will have incremental bugfixes and usability tweaks, while another team works on version 2.0 with large-scale changes, where the core of the product may have been completel... | <p>One good way is to fix each bug in the stable branch and merge the stable branch into the development branch. This is the <a href="http://www.cmcrossroads.com/bradapp/acme/branching/branch-structs.html#ParallelMaintDev" rel="nofollow noreferrer">Parallel Maintenance/Development Lines</a> pattern, and the key is to m... | <p>Merge early, merge often, and make sure that QA on the mainline knows and regresses/verifies the defects fixed in each patch of the maintenance releases. </p>
<p>It's really easy to let something slip out and "unfix" a bug in a subsequent release, and let me tell you, customers don't care about how complicated it ... | 6,634 |
<p>I have following POJOs:</p>
<pre><code>class Month {
long id;
String description;
List<Day> days; // always contains 29, 30 or 31 elements
}
class Day {
byte nr; // possible values are 1-31
String info;
}
</code></pre>
<p>Is there a way to store these objects into following DB structure ... | <p>If you can't change your pojo's or table structure you are a bit screwed. If you can then a simple annotated pojo will work. </p>
<pre><code>class Month {
@Id
private long id;
private String description;
@OneToMany(mappedBy="month",fetchType=Lazy)
private List<Day> days;
}
</code></pre>
<p>--... | <p>Here is one solution I found:</p>
<pre><code>class Month {
long id;
String description;
@CollectionOfElements(fetch = FetchType.EAGER)
@IndexColumn(name = "nr-of-day")
List<Day> days; // always contains 29, 30 or 31 elements
}
@Embeddable
class Day {
byte nr; // possible values are 1... | 41,207 |
<p>We got <a href="https://3dprinting.meta.stackexchange.com/questions/314/can-we-get-mathjax-enabled">MathJax enabled</a>. Today I learned that there is even more! We could have <a href="https://worldbuilding.meta.stackexchange.com/questions/9710/can-we-extend-mhchem-support-in-mathjax-to-include-physical-units?cb=1">... | <p>The deed is done. Behold! In all its glory:</p>
<p><span class="math-container">$$\pu{273.15 K}$$</span></p>
| <p>I do not support this request to support physical units.</p>
<p><em>(vote up this answer if you are not in favor)</em></p>
| 81 |
<p>Up to now in my application, I've been supporting all flavors of Windows from Windows 98 to Windows NT/2000 to XP to Vista.</p>
<p>But because of adding Unicode in my next version, support of Windows 98 would still be possible, but very difficult.</p>
<p>I know there are still some of my users running Windows 98. ... | <p>Dropping support for Win98 opens up a whole host of new Win32 API's that you can use in your software. This will allow you to provide a better experience for the majority of your customers on newer OS's.</p>
<p>Continue to provide the current version of your software for Win98 users, but make it clear that Win98 wi... | <p>Depending on your roadmap and technologies you use - it may be possible (but a bit of a pain) to branch your code. Using a decent SCM system, you could develop in your "new" branch and back-port (merge) features and bug fixes that are also relevant to the win98 branch.</p>
<p>It's a bit of work, but it would allow ... | 41,028 |
<p>What are the most user-friendly color combinations for Web 2.0 websites, such as background, button colors, etc.? </p>
| <p><a href="http://www.colorschemer.com/online.html" rel="noreferrer">ColorSchemer</a> will suggest good schemes for you.</p>
<p>If you want to try something out on your own, try <a href="http://www.colorcombos.com/" rel="noreferrer">Color Combinations</a>.</p>
| <p><a href="http://useit.mondosearch.com/cgi-bin/MsmFind.exe?QUERY=color" rel="nofollow noreferrer">search for color on useit</a> </p>
<p><a href="http://www.boxesandarrows.com/search?q=color" rel="nofollow noreferrer">search for color on boxesandarrows</a></p>
<p>There has been loads of research on this sort of stuf... | 4,799 |
<p>Want a WYSIWYG jQuery Editor as an example to illustrate how to use jQuery to built OOP javascript component. </p>
<p>P.S.
It is so good stackoverflow can use markdown... Would be a heaven if users would love such thing too</p>
| <p><a href="http://jhtmlarea.codeplex.com" rel="nofollow noreferrer">jHtmlArea - WYSIWYG HTML Editor for jQuery</a></p>
<p>A simple, light weight, extensible WYSIWYG HTML Editor built on top of jQuery. This component allows you to easily display a WYSIWYG HTML Editor in place of any TextArea DOM Elements on the page. ... | <p><a href="http://wmd-editor.com/features#compatibility" rel="nofollow noreferrer">http://wmd-editor.com/features#compatibility</a></p>
<p>or maybe if you just have time to write/modify for your own parse (as i will do)
use this: </p>
<p><a href="http://markitup.jaysalvat.com" rel="nofollow noreferrer">http://markit... | 11,072 |
<pre><code>public enum myEnum {
VAL1(10), VAL2(20), VAL3("hai") {
public Object getValue() {
return this.strVal;
}
public String showMsg() {
return "This is your msg!";
}
};
String strVal;
Integer intVal;
public Object getValue() {
retu... | <p>Your class myEnum inherits from java.lang.Enum. VAL3 is an anonymous inner class that inherits from myEnum called myEnum$1. Think of the enum keyword as syntatic sugar. It sets up classes with normal inheritance trees for you, but will not allow you to extend java.lang.Enum or myEnum directly.</p>
| <p>From decompiler</p>
<pre><code>
package com.sun.tools.xjc.outline;
public final class Aspect extends Enum
{
public static final Aspect EXPOSED;
public static final Aspect IMPLEMENTATION;
private static final Aspect $VALUES[];
static
{
EXPOSED = new Aspect("EXPOSED", 0);
IMPLE... | 41,340 |
<p>example:</p>
<pre><code>a_list = [1, 2, 3]
a_list.len() # doesn't work
len(a_list) # works
</code></pre>
<p>Python being (very) object oriented, I don't understand why the 'len' function isn't inherited by the object.
Plus I keep trying the wrong solution since it appears as the logical one to me</p>
| <p>Guido's explanation is <a href="http://mail.python.org/pipermail/python-3000/2006-November/004643.html" rel="noreferrer">here</a>:</p>
<blockquote>
<p>First of all, I chose len(x) over x.len() for HCI reasons (def __len__() came much later). There are two intertwined reasons actually, both HCI:</p>
<p>(a) For some o... | <p>Maybe you're looking for <code>__len__</code>. If that method exists, then len(a) calls it:</p>
<pre><code>>>> class Spam:
... def __len__(self): return 3
...
>>> s = Spam()
>>> len(s)
3
</code></pre>
| 10,953 |
<p>Staring JBoss server from within Eclipse Ganymede gives me the following problem:
"Server JBoss v4.0 at localhost was unable to start within 120 seconds. If the server requires more time, try increasing the timeout in the server editor."</p>
<p>The console shows JBoss has started in so and so minutes but soon after... | <p>I had a similar problem, but it was with a Tomcat 5.5 server.
The startup time was quite important, so I got this error.</p>
<p>To solve this problem, I did that steps:
In Preferences, Server, I changed the property "Server timeout delay" to "Unlimited".</p>
<p><strong>Edit:</strong></p>
<p>For Eclipse Ganymede, ... | <p>You may check whether you are running Jboss version 4.0.4 or version 4.2.2. You might get this error when you have installed Jboss 4.2.2 but configured Jboss 4.0.4 in Eclipse.</p>
| 38,182 |
<p>Suppose that I have a Java class with a static method, like so:</p>
<pre>
class A
{
static void foo()
{
// Which class invoked me?
}
}
</pre>
<p>And suppose further that class A has an arbitrary number of subclasses:</p>
<pre>
class B extends A { }
class C extends A { }
class D extends A { }
.... | <p>It can't, and that's part of the problem with static methods. As far as the compiler is concerned <code>A.foo()</code> and <code>B.foo()</code> are exactly the same thing. In fact, they compile down to the same bytecode. You can't get more similar than that.</p>
<p>If you really need this sort of information, us... | <pre><code>class A
{
static void foo(A whoIsCalingMe)
{
// Which class invoked me?
}
}
</code></pre>
| 35,851 |
<p>As I understand it, when asked to reserve a larger block of memory, the realloc() function will do one of three different things:</p>
<p><code><pre>
if free contiguous block exists
grow current block
else if sufficient memory
allocate new memory
copy old memory to new
free old memory
else
return... | <p><code>realloc()</code>'s behavior is likely dependent on its specific implementation. And basing your code on that would be a terrible hack which, to say the least, violates encapsulation.</p>
<p>A better solution for your specific example is:</p>
<ol>
<li>Find the size of the current buffer
<ul>
<li>Allocate a n... | <p>No <strike>- and if you think about it, it can't work. Between you checking what it's going to do and actually doing it, another process could allocate memory.</strike>
In a multi-threaded application this can't work. Between you checking what it's going to do and actually doing it, another thread could allocate mem... | 26,605 |
<p>I learned that by trying to use the tablesorter plug in from jquery the table needs to use the < thead> and<br>
< tbody> tags. I am using an html table, and I use the runat="server" attribute because I need to bind data to the table on the server side. but by using the runat= server attribute the code is rend... | <p>You should take a look here -<a href="http://www.codeproject.com/KB/aspnet/SortableGridViewjQuery.aspx" rel="noreferrer">Code Project Sortable Gridview using JQuery Tablesorter</a></p>
<p>Essentially, you need to use the <a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.useaccessi... | <p>start with this...</p>
<pre><code>print("<table class='turnMeIntoTableSort'><tr><td>heading1</td><td>heading2</td></tr><tr><td>content1</td><td>content2</td></tr><tr><td>content3</td><td>content4</td></tr&... | 48,295 |
<p>Is it faster to do the following:</p>
<pre><code> if ($var != 'test1' && $var != 'test2' && $var != 'test3' && $var != 'test4') { ... }
</code></pre>
<p>Or:</p>
<pre><code> if (!in_array($var, array('test1', 'test2', 'test3', 'test4') { ... }
</code></pre>
<p>Is there a number of values a... | <p>i'd strongly suggest just using <code>in_array()</code>, any speed difference would be negligible, but the readability of testing each variable separately is horrible.</p>
<p>just for fun here's a test i ran:</p>
<pre><code>$array = array('test1', 'test2', 'test3', 'test4');
$var = 'test';
$iterations = 1000000;
$s... | <p>I know this question is nearly 10 years old, but there are other ways to do this. I used method B from <a href="http://nickology.com/2012/07/03/php-faster-array-lookup-than-using-in_array/" rel="nofollow noreferrer">Nick's page</a> with thousands of entries. It was incredibly fast.</p>
<pre><code>foreach(array_valu... | 42,042 |
<p>I wonder why no browser out there has such simple but essential feature. Am I missing something? Is there a technical reason?</p>
<p>I'm tired of all those javascript/flash/java hacks out there ...</p>
| <p>There is no technical reason preventing the browser from calculating the total bytes to be sent and then tracking how many have been received by the server (Thanks, Kibbee for your comment). Firefox had a functional upload progress indicator until version 0.9, but that <a href="https://bugzilla.mozilla.org/show_bug.... | <p>The web browser has always been that, a browser of the web. It is a mechanism for consumption. Our ability to upload information through the same portal is somewhat of a hack. </p>
| 29,123 |
<p>Can you add new statements (like <code>print</code>, <code>raise</code>, <code>with</code>) to Python's syntax?</p>
<p>Say, to allow..</p>
<pre><code>mystatement "Something"
</code></pre>
<p>Or,</p>
<pre><code>new_if True:
print "example"
</code></pre>
<p>Not so much if you <em>should</em>, but rather if it... | <p>You may find this useful - <a href="http://eli.thegreenplace.net/2010/06/30/python-internals-adding-a-new-statement-to-python/" rel="noreferrer">Python internals: adding a new statement to Python</a>, quoted here:</p>
<hr>
<p>This article is an attempt to better understand how the front-end of Python works. Just r... | <p>Ten years ago you couldn't, and I doubt that's changed. However, it wasn't that hard to modify the syntax back then if you were prepared to recompile python, and I doubt that's changed, either.</p>
| 26,413 |
<p>What is the difference between using the <code>Runnable</code> and <code>Callable</code> interfaces when designing a concurrent thread in Java, why would you choose one over the other?</p>
| <p>See explanation <a href="http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/Callable.html" rel="noreferrer">here</a>.</p>
<blockquote>
<p>The Callable interface is similar to
Runnable, in that both are designed
for classes whose instances are
potentially executed by another
thread. <strong>A Ru... | <p>In addition to all other answers:</p>
<p>We can not pass/use Callable to an individual thread for execution i.e. Callable can be used only in Executor Framework.
But, Runnable can be passed to an individual thread for execution (new Thread(new CustomRunnable())), as well as can be used in Executor Framework.</p>
| 17,066 |
<p>For years, I've been investigating how to create music streams from my computer. I've seen programs, but anything useful I've seen is Windows only (I use a Mac).</p>
<p>Eventually, I got interested in <em>how</em> streams work. Is there any way I could create my <em>own</em> stream, possibly using socket function... | <p>Take a look at <a href="http://ampache.org/" rel="nofollow noreferrer">Ampache</a>. It is a Web-based Open Source Audio file manager. It is implemented with MySQL, and PHP. It allows you to view, edit, and play your audio files via the web.</p>
| <p>In the end it all boils down to the protocol you'd want to use. Shoutcast IMHO is plain HTTP, so to <em>make</em> your own stream, you just output the streams content.</p>
<p>To make an ogg based webradio work with my Sonos system, I have created a little transcoding wrapper around sox which is is actually written ... | 6,697 |
<p>I'm implementing unit tests for a family of functions that all share a number of invariants. For example, calling the function with two matrices produce a matrix of known shape.</p>
<p>I would like to write unit tests to test the entire family of functions for this property, without having to write an individual te... | <p>You could use a metaclass to dynamically insert the tests. This works fine for me:</p>
<pre><code>import unittest
class UnderTest(object):
def f1(self, i):
return i + 1
def f2(self, i):
return i + 2
class TestMeta(type):
def __new__(cls, name, bases, attrs):
funcs = [t for ... | <blockquote>
<p>The problem with this approach is that
if any element of the list fails the
test, the later elements don't get
tested.</p>
</blockquote>
<p>If you look at it from the point of view that, if a test fails, that is critical and your entire package is invalid, then it doesn't matter that other elem... | 45,165 |
<p>When asked to create system XYZ and you ask to do it in Python over PHP or Ruby, what are the main features you can mention when they require you to explain it?</p>
| <p>This is one of those cases that really boil down to personal preference or situational details. If you're more comfortable and experienced with Python, then say so. Are they asking you to justify it because they're more comfortable with one of the other environments? After you're done, will the system be passed off ... | <p>I agree with mreggen. Tell them by working in Python you can get things done faster. Getting things done faster possibly means money saved by the client. In the least it means that you are working with a language you a more comfortable in, meaning faster development, debugging, and refactoring time. There will be le... | 2,693 |
<p>I have a simple cart page that displays items that are in someones cart, and having it display via an ASP while from my table. I have a column where a user can delete an entry. I have the ASP working properly, now I am trying to add some AJAX in to it. I have the following code:</p>
<pre><code>$("img.delete").click... | <p>You need to select only the item's row for removal. I'm not sure how you have it set up, but if the image element is inside the row you could use:</p>
<pre><code> $("img.delete").click(function() {
var row = $(this).parents('tr:first');
...
success: function(){
$(row).remove(); //Remo... | <p>If it is the html id-attribute you want, then that would work. Why don't you try it?</p>
<p>EDIT: It might be just row.attr('id'); It have slipped from my mind, havn't ben using jQuery for sometime :)</p>
| 49,120 |
<p>This pretty much has me defeated.</p>
<p>On XP and earlier versions of Windows you could customise Open With filetypes to include java - jar "myjar.jar", but on Vista this functionality seems to have been removed. I can of course create a .bat file to launch my application, but is it possible to make Vista execute ... | <p>You can do it from the command line with 2 utilities.</p>
<p>The first one, ASSOC, is used to create a file association. To verify if there is one defined for JAR type :</p>
<pre><code>>assoc .jar
.jar=jarfile
</code></pre>
<p>If not found then create it with :</p>
<pre><code>>assoc .jar=jarfile
</code></p... | <p>Use the software JarFix >= 1.1.0 .
There is Vista support included and it "recovers" the .jar association!</p>
<p>download for example here:
<a href="http://www.softpedia.com/get/Others/Miscellaneous/Jarfix.shtml" rel="nofollow noreferrer">http://www.softpedia.com/get/Others/Miscellaneous/Jarfix.shtml</a></p>
| 46,204 |
<p>On a Cartesian printer movements are really simple. If we assume the printer has 100 steps/mm on each axis, then a move of 10mm on a axis is just 1000 Steps on that axis.</p>
<p>Movements that are not aligned with one axis are also simple. Moving from x,y = 0,0 to 10,10 would be 1000 steps on x and y.</p>
<p>On de... | <p>There are two main special steps to the technique used by most open-source 3d printer controllers:</p>
<ol>
<li>Divide each linear gcode segment into lots of very small subsegments ("Segmentation")</li>
<li>Use some basic trigonometry or the pythagorean theorem to tie extruder position to carriage height for each o... | <p>I am describing how this is done in the Marlin firmware.</p>
<p>The first step is to split a linear movement from (x, y, z) to (x', y', z') into many discrete segments. To this end, the amount of time the move would take at a given speed is calculated, and the value <em>delta_segments_per_second</em> is used to cal... | 199 |
<p>I have an Excel application in which I want to present the user with a list of the Data Source Names (ie: DSN's), whereby s/he can choose what data source to use.</p>
<p>Hopefully once I've got the list, I can easily access the DSN properties to connect to the appropriate database.</p>
<p>Please note, I do <em>not... | <p>The DSN entries are stored in the registry in the following keys.</p>
<pre>HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ODBC Data Sources
HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources</pre>
<p>This contains the list of all defined DSN. This acts as an global index and the specific details for each DSN ar... | <p>You can use the <b>SQLDataSources</b> function of the ODBC API. See <a href="http://msdn.microsoft.com/en-us/library/ms711004.aspx" rel="nofollow noreferrer">MSDN documentation</a>.</p>
| 19,938 |
<p>Since you guys are having lots of questions or not enough info to work with, below is proprietary information and as such be careful as you can. The question – (please refer to if [$7 -eq "AAA"]...then statement - in bold ) has a problem with an output, where I can only output/print count of 'AAA' regardless the v... | <p>Anything between "sqlplus -s $1 << EOF" and "EOF" is called "here-doc" and intended for consumption by sqlplus. You can't really expect sqlplus to understand shell scripting in the form of "if [ "$7" -eq ....] ".</p>
<p>You should make all "ifs" outside of the here-doc and use results in it. Like this:</p>
<... | <p>How can the script possibly continue after this code:</p>
<pre><code>#-------------
#---- AAA ----
#-------------
if [ $7 -eq "AAA" ] then
SELECT 'Total AAA Updated: '||count(*)||' records'
FROM reldatetemp
,allcustomers
WHERE trx_num = trx_no
AND error_t... | 37,958 |
<p>I have a simple C++ DLL that implements a few custom actions for a WiX installer.</p>
<p>Debugging the custom actions is usually simple: put up a temporary dialog box at the beginning of the action, and attach to the process when the dialog box appears.</p>
<p>But today, whenever I attach to the process, I get the... | <p>After hours of trying to figure this out, I realized that the problem was that I had debugging symbols enabled in Tools->Options->Debugging->Symbols. The latency in looking up symbols was leading to the apparent lockup.</p>
<p>Clearing the "Search the above locations only when symbols are loaded manually" seems to ... | <p>Are you referring debug symbols from a network location that is not available (e.g. a ClearCase dynamic view or something similar). This can cause Visual Studio to hang when you attach to a process.</p>
<p>Check Tools->Options->Debugging->Symbols and try temporarily disabling the symbol file (.pdb) locations until... | 19,456 |
<p>I am trying to help someone write a program that I thought would be easy, but of course it never is :)</p>
<p>I am trying to take a class roster (usually between 10-20 students) and effectivly uniquely pair off each classmate to another to make unique groups. Therefore in a class of 10 people, you can have 9 groups... | <p>You want to create a complete graph with each student as a node, then randomly select edges and insert them into a unique set.</p>
<p>On the next "pull", you want to do the same thing, except now if the edge has already been selected, discard and reselect.</p>
| <p>I don't know if it's exactly what you asked for, but here my take on it in simple python.
It spits out each unique grouping you can have for (in my example) 10 students.</p>
<p>It is not the fastest thing there is i guess, but its very easy to implement and to follow.</p>
<pre class="lang-py prettyprint-override">... | 24,347 |
<p>I'm working on a big .NET 1.1 project, and there exists a wish to upgrade this, majorily to be able to use better tools like Visual Studio 2008, but also because of the new features and smaller amount of bugs in the .NET 2.0 framework.</p>
<p>The project consist for the bigger part of VB.NET, but there are also par... | <p>We're looking at doing the same migration right now Tobi. First, you can get a good idea of what to expect by making a copy of your project (or a portion of it) and give it a "dry run" through the .NET 2.0 compiler. My experience with this was that the 2.0 compiler gives more warnings about bad programming practic... | <p>You probably won't have any <strong>breaking</strong> issues, though you may get some deprecated method warnings. The compiler should generally tell you what the replacement is though. I know that some of the System.Configuration things were updated.</p>
| 8,167 |
<p>I need to cut out and save/use part of a string in C#. I figure the best way to do this is by using Regex. My string looks like this:</p>
<p><code>"changed from 1 to 10"</code>. </p>
<p>I need a way to cut out the two numbers and use them elsewhere. What's a good way to do this?</p>
| <p>Error checking left as an exercise...</p>
<pre><code> Regex regex = new Regex( @"\d+" );
MatchCollection matches = regex.Matches( "changed from 1 to 10" );
int num1 = int.Parse( matches[0].Value );
int num2 = int.Parse( matches[1].Value );
</code></pre>
| <p>Here is a code snippet that does <em>almost</em> what I wanted:</p>
<pre><code>using System.Text.RegularExpressions;
string text = "changed from 1 to 10";
string pattern = @"\b(?<digit>\d+)\b";
Regex r = new Regex(pattern);
MatchCollection mc = r.Matches(text);
foreach (Match m in mc) {
CaptureCollection... | 36,498 |
<p>I just have started to learn Haskell and combine reading books and tutorials with solving problems from Project Euler. I have stuck on <a href="http://projecteuler.net/index.php?section=problems&id=27" rel="nofollow noreferrer">Problem 27</a> because I get "C stack overflow" error using this code: </p>
<p><stro... | <p>A "stack overflow" error means that the chain of function calls in your program (from the entry function down to the currently executing function) has grown too large. Most compilers and runtimes implement the call chain as a stack data structure—each element is a "stack frame" containing the local variables a... | <p>I don't know why <a href="https://stackoverflow.com/users/34509/litb">litb</a> put his answer into a comment instead of an answer, so I'm copying it here so that people will see it:</p>
<p><a href="http://www.haskell.org/haskellwiki/Stack_overflow" rel="nofollow noreferrer">http://www.haskell.org/haskellwiki/Stack_... | 48,426 |
<p>Got my Ender 3 v2 and stack with the bed leveling.</p>
<p>Used default settings, Creality slicer 4.2, test PLA from the kit and print model <a href="https://www.thingiverse.com/thing:3013319" rel="nofollow noreferrer">https://www.thingiverse.com/thing:3013319</a> (4 squares in each corner and 1 in the middle), nozzl... | <p>The gaps are, because the nozzle is to far from the bed at this point. It may sound like a big deal, but actually this is not leveling alone, but it looks like the bed is not a perfect plane/perfectly flat. This is normal, my ikea mirror and my stock bed show the same thing. Now here's one solution:</p>
<p>Print cal... | <p>I had exact same issues with my Ender 3 v2. Using the stock default glass the middle would be too far out and I was never able to level it just right - no matter what I did - I could have stayed on it for hours.</p>
<p>In matter of fact, it wasn't just the middle, it was the middle between each of the corner points ... | 1,709 |
<p>I use <code>PHPMyAdmi</code>n for convenience in updating a remote database.</p>
<p>But it doesn't show warnings, by default, which recently got me into some embarrassing trouble where I was updating a SET field with string not on its list and not noticing the problem. </p>
<p>I'm using <code>2.11.9.1 (Dreamhost's... | <p>I don't believe Dreamhost gives you access to the configuration file for their installation of phpMyAdmin. However, you can easily make your own installation of phpMyAdmin by downloading the source from <a href="http://www.phpmyadmin.net/home_page/index.php" rel="nofollow noreferrer">their website</a> and just unta... | <p>I could be mistaken but if I remember correctly you need to have access to the phpMyAdmin config file to enable it.</p>
| 13,228 |
<p>Do objects added to the SqlException.Data collection need to be [Serializable]?</p>
| <p>Yes, they need to be. It's because ISerializable's implementation in Exception type add Data property into StreamingContext. And all objects in Data property (which is a IDictionary) must be serializable.
Having exception classes and instances serializable is good practice even if aren't going to build distributed a... | <p>Well, strictly speaking, no... you can add any type to an Exception's Data dictionary... but why would you ask? What boundary do you think they are going to be serialized across?</p>
| 19,322 |
<p>Does anybody know if there is a way to make autocompletion work in MySQL Command Line Client under Windows? It's working nicely under Linux for me, but simply moves the cursor under Windows instead.</p>
| <p>It ought to work this way:</p>
<pre><code>C:\> mysql --auto-rehash
</code></pre>
<p>Or configure your my.cnf:</p>
<pre><code>[mysql]
auto-rehash
</code></pre>
<p><strong>edit:</strong> My apologies. I have found some references that the tab-completion feature in mysql client works only on UNIX/Linux. It do... | <p>This is probably not what you are looking for, but the enterprise version of SQLYog offers a somewhat limited schema auto-completion.</p>
| 33,877 |
<p>I have an application that works pretty well in Ubuntu, Windows and the Xandros that come with the Asus EeePC.</p>
<p>Now we are moving to the <a href="http://en.wikipedia.org/wiki/Aspire_One" rel="nofollow noreferrer">Acer Aspire One</a> but I'm having a lot of trouble making php-gtk to compile under the Fedora-li... | <p>Hi Guys well I finally got this thing to work the basic workflow was this:</p>
<pre><code>#!/bin/bash
sudo yum install yum-utils
#We don't want to update the main gtk2 by mistake so we download them
#manually and install with no-deps[1](and forced because gtk version
#version of AA1 and the gtk2-devel aren't compat... | <p>If you could give us more to go on than just trouble making it compile; we might be better able to help you with your issues.</p>
| 10,383 |
<p>Using Oracle, if a column value can be 'YES' or 'NO' is it possible to constrain a table so that only one row can have a 'YES' value?</p>
<p>I would rather redesign the table structure but this is not possible.</p>
<p>[UDPATE] Sadly, null values are not allowed in this table.</p>
| <p>Use a function-based index:</p>
<pre><code>create unique index only_one_yes on mytable
(case when col='YES' then 'YES' end);
</code></pre>
<p>Oracle only indexes keys that are not completely null, and the CASE expression here ensures that all the 'NO' values are changed to nulls and so not indexed.</p>
| <p>I guess I'd use a second table to point to the appropriate row in your current table. That other table could be used to store values of other variables too too.</p>
| 22,024 |
<p>I have a function that resembles the one below. I'm not sure how to use the os module to get back to my original working directory at the conclusion of the jar's execution. </p>
<pre><code>def run():
owd = os.getcwd()
#first change dir to build_dir path
os.chdir(testDir)
#run jar from test director... | <p>You simply need to add the line:</p>
<pre><code>os.chdir(owd)
</code></pre>
<p>Just a note this was also answered in your other <A href="http://stackoverflow.com/questions/299249/how-can-i-get-my-python-version-25-script-to-run-a-jar-file-inside-a-folder-ins">question</A>.</p>
| <p>I looked around the answers on StackOverflow and eventually decided to write my own decorator for this purpose:</p>
<pre><code>from collections.abc import Callable
from functools import wraps
from typing import ParamSpec, TypeVar
T = TypeVar('T')
P = ParamSpec('P')
def enter_subdir(subdir: str) -> Cal... | 38,362 |
<p>Windows, Firefox or Google Chrome all monitor usage statistics and analyze the crash reports are sent to them. I am thinking of implementing the same feature into my application. </p>
<p>Of course it's easy to litter an application with a lot of logging statement, but this is the approach that I want to avoid becau... | <p>In "Debugging .Net 2.0 Applications" John Robbins (of Wintellect) writes extensively about how to generate and debug crash reports (acutally windbg/SOS mini dumps). His Superassert class contains code to generate these. Be warned though - there is a lot of effort required to set this up properly: symbol servers, s... | <p>I would take a quick look at the Logging Application Block that is part of the Enterprise Library. It provided a large number of the things you require, and is well maintained. Check out some of the scenarios and samples available, I think you will find them to your liking.</p>
<p><a href="http://msdn.microsoft.c... | 48,876 |
<p>There are all sorts of stories of what to put on your printer bed to make your part not come loose when it is printing but can be removed after it is done without requiring a hammer and chisel.</p>
<p>Is there anything out there that shows an analytical comparison?</p>
<p>My biggest interest is PLA on a heated gla... | <p>I use a product called <a href="http://www.3dlac.com/index.php/en/" rel="nofollow noreferrer">3DLAC</a> but I suppose it's regular hairspray. Makes my PLA stick to the heated bed like a charm. After cooling down the print can be removed from the bed with ease.</p>
<p>Only today, after a few thousand prints the glas... | <p>I use a product called <a href="http://www.3dlac.com/index.php/en/" rel="nofollow noreferrer">3DLAC</a> but I suppose it's regular hairspray. Makes my PLA stick to the heated bed like a charm. After cooling down the print can be removed from the bed with ease.</p>
<p>Only today, after a few thousand prints the glas... | 597 |
<p>I have a web application where there are number of Ajax components which refresh themselves every so often inside a page (it's a dashboard of sorts).</p>
<p>Now, I want to add functionality to the page so that when there is no Internet connectivity, the current content of the page doesn't change and a message appea... | <pre><code>navigator.onLine
</code></pre>
<p>That should do what you're asking.</p>
<p>You probably want to check that in whatever code you have that updates the page. Eg:</p>
<pre><code>if (navigator.onLine) {
updatePage();
} else {
displayOfflineWarning();
}
</code></pre>
| <p>One possible solution is that if the page and the cached page have a different url to just look and see what url you are on. If you are on the url of the cached page then you are in offline mode. <a href="http://remysharp.com/2011/04/19/broken-offline-support/" rel="nofollow">This</a> blog makes a good point about w... | 12,036 |
<p>We currently have an appserver setup where EVERYTHING is off of one big context root, and we copy class files and restart app servers to deploy. Not ideal.
I'm trying to set up an ant script to do the build and deploy using wdeploy, and everything works, except I need my servlet to forward to jsps outside of the con... | <p>There are a number of them depending on the type you are casting to</p>
<pre><code>cint() Cast to integer
cstr() cast to string
clng() cast to long
cdbl() cast to double
cdate() cast to date
</code></pre>
<p>It also has implicit casting so you can do this myString=myInt</p>
| <p>Ctype() I believe. The C* (CDate(), CStr(), etc) are holdovers for the most part. </p>
| 39,488 |
<p>Is there anything like Firebug that you can use within Google Chrome?</p>
<p>Essential features I would like:</p>
<ul>
<li>Inspect HTML source (select elements, delete them, etc.)</li>
<li>check CSS values (the built-in solution is weird, somehow)</li>
</ul>
| <p>There is a Firebug-like tool already built into Chrome. Just right click anywhere on a page and choose "Inspect element" from the menu. Chrome has a graphical tool for debugging (like in Firebug), so you can debug JavaScript. It also does CSS inspection well and can even change CSS rendering on the fly.</p>
<p>For ... | <p>If you are using Chromium on Ubuntu using the nightly ppa, then you should have the <code>chromium-browser-inspector</code></p>
| 39,678 |
<p>As of the fall of 2008 I'm about to embark on a new development cycle for a major product that has a winforms and an asp.net interface. We use Telerik, DevExpress and Infragistics components in it and all are going to have a release within a month or so which will be the one I target for our spring release of our p... | <p>It's worth it. It's faster, the designer is vastly improved (split view, faster context switching), it has better support for javascript and when you're ready to target 3.5, you'll be ready to go.</p>
| <p>It is worth the upgrade for me for the main reason that I can target different .NET versions (2, 3, 3.5) from the same IDE whereas in the past, one version of Visual Studio supported one version of .NET.</p>
<p>The UI seems much more responsive now, but the core set of tools and processes hasn't changed that much.<... | 9,047 |
<p>I want to play around a bit with FLASH for app development. I'm looking for a good IDE for that. Someone suggested Flash Develop.</p>
| <p><strong>Flash Builder</strong></p>
<p><em>Pros</em></p>
<ul>
<li>better debugging and profiling </li>
<li>visual designer for MXML</li>
<li>because of Eclipse: support for other languages (eg. with Aptana, PDT...) and usage of plug-ins for the Eclipse Platform with features not shipped with FlexBuilder (code snipp... | <p>Along with what was already mentioned, Flex Builder has some nice tools that helps a developer to learn how to create a data enabled Flex application in form of the <strong>Data Wizards</strong> and also a nice <strong>web services introspection</strong> tool that automatically creates an ActionScript 3 client for a... | 40,314 |
<p>I'm using the urlrewriter.net as recommended in several questions in here.
I'm having difficulties with displaying images and with the stylesheet.</p>
<p>I read ScottGu's Blog (again as recommended in here) and in the end he does reffer to this problem and states to use ~/ for server controls etc. ("Handling CSS an... | <p>In my experience <strong>the base tag is the source of far more problems than it solves</strong> </p>
<p>I strongly suggest the first option, of limiting what the URLrewriter is allowed to effect by i.e. <strong>checking for .aspx</strong> extension before acting.</p>
| <p>I think you need to exclude your stylesheets and image directories from the rewrite engine. I am not familiar with the engine you are using, but if you are using a rewrite rule that rewrites based on a very wide rule, it will incorrectly point to your stylesheets and images, and javascripts I believe.</p>
<p>You co... | 45,106 |
<p>I need to make an ArrayList of ArrayLists thread safe. I also cannot have the client making changes to the collection. Will the unmodifiable wrapper make it thread safe or do I need two wrappers on the collection?</p>
| <p>It depends. The wrapper will only prevent changes to the collection it wraps, not to the objects in the collection. If you have an ArrayList of ArrayLists, the global List as well as each of its element Lists need to be wrapped separately, and you may also have to do something for the contents of those lists. Finall... | <p>This is neccessary if:</p>
<ol>
<li>There is still a reference to the original modifiable list.</li>
<li>The list will possibly be accessed though an iterator.</li>
</ol>
<p>If you intend to read from the ArrayList by index only you could assume this is thread-safe.</p>
<p>When in doubt, chose the synchronized wr... | 11,368 |
<p>If I inherit from a base class and want to pass something from the constructor of the inherited class to the constructor of the base class, how do I do that?</p>
<p>For example, if I inherit from the Exception class I want to do something like this:</p>
<pre><code>class MyExceptionClass : Exception
{
public M... | <p>Modify your constructor to the following so that it calls the base class constructor properly:</p>
<pre><code>public class MyExceptionClass : Exception
{
public MyExceptionClass(string message, string extrainfo) : base(message)
{
//other stuff here
}
}
</code></pre>
<p>Note that a constructor i... | <p>Using newer C# features, namely <code>out var</code>, you can get rid of the static factory-method.
I just found out (by accident) that out var parameter of methods called inse base-"call" flow to the constructor body.</p>
<p>Example, using this base class you want to derive from:</p>
<pre><code>public abstract cl... | 3,315 |
<p>this code always returns 0 in PHP 5.2.5 for microseconds:</p>
<pre><code><?php
$dt = new DateTime();
echo $dt->format("Y-m-d\TH:i:s.u") . "\n";
?>
</code></pre>
<p>Output:</p>
<pre><code>[root@www1 ~]$ php date_test.php
2008-10-03T20:31:26.000000
[root@www1 ~]$ php date_test.php
2008-10-03T20:31:27.00000... | <p>This seems to work, although it seems illogical that <a href="http://us.php.net/date" rel="noreferrer">http://us.php.net/date</a> documents the microsecond specifier yet doesn't really support it:</p>
<pre><code>function getTimestamp()
{
return date("Y-m-d\TH:i:s") . substr((string)microtime(), 1, 8);
}
</c... | <p>date('u') is supported only from PHP 5.2. Your PHP may be older!</p>
| 20,453 |
<p>What is the best way to approach removing items from a collection in C#, once the item is known, but not it's index. This is one way to do it, but it seems inelegant at best.</p>
<pre><code>//Remove the existing role assignment for the user.
int cnt = 0;
int assToDelete = 0;
foreach (SPRoleAssignment spAssignment ... | <p>If RoleAssignments is a <code>List<T></code> you can use the following code.</p>
<pre><code>workSpace.RoleAssignments.RemoveAll(x =>x.Member.Name == shortName);
</code></pre>
| <p>There is another approach you can take depending on how you're using your collection. If you're downloading the assignments one time (e.g., when the app runs), you could translate the collection on the fly into a hashtable where:</p>
<p>shortname => SPRoleAssignment</p>
<p>If you do this, then when you want to rem... | 25,377 |
<p>How can I create an empty one-dimensional string array?</p>
| <p>Dim strEmpty(-1) As String</p>
| <p>try this
Dim Arraystr() as String ={}</p>
| 6,645 |
<p>I've observed printing PETG that the primary if not the only reason for using a high bed temperature seems to be preventing the bed from acting as a huge heat sink and rapidly cooling the initial layers such that they don't bond well to each other. In particulat, the heat is not needed for adhesion-to-the-bed purpos... | <p>You can place a 2-4 mm thick MDF board on the bed and print directly on it, or you can place a 2 mm thick cork foil (IKEA office desk supplies) between magnetic plate and aluminium heater. The magnetic plate should not absorb too much heat and the cork will avoid conduction to the aluminium heater.</p>
<p>If you wan... | <p>I’m pretty sure it can be brought separately but usually comes with a lot of heat-beds; It is a type of foam that has adhesive on one side and aluminum foil on the other. <a href="https://www.ebay.com.au/itm/3D-Printer-Parts-Heat-Insulation-Cotton-200-220-300mm-Foil-cotton-3D-printer-/193735774067?_trksid=p2349624.m... | 1,945 |
<p>What I want to do is drawing a (large) terrain with OpenGL. So I have a set of vertices, lets say 256 x 256 which I store in a vertex buffer object in the VRAM. I properly triangulated them, so I've got an index buffer for the faces.</p>
<pre><code>// vertexes
glBindBufferARB(GL_ARRAY_BUFFER_ARB, vertexBufferId);
g... | <p>If your texture should repeat (or mirror) itself in each quad the best way would be to use texture coordinates that match the number of the (x, y) position in your array. E.g. for the first line of vertices use these texture coordinates: (0.0, 0.0), (1.0, 0.0), (2.0, 0.0)...(255.0, 0.0).</p>
| <p>As you probably want your texture to seamlessly tile, all you need to is to compute the proper texture coordinate for each vertex and pass them just like the vertices. </p>
| 49,581 |
<p>I want to generate some XML in a stored procedure based on data in a table.</p>
<p>The following insert allows me to add many nodes but they have to be hard-coded or use variables (sql:variable):</p>
<pre><code>SET @MyXml.modify('
insert
<myNode>
{sql:variable("@MyVariable")}
... | <p>Have you tried <b>nesting</b> FOR XML PATH scalar valued functions?
With the nesting technique, you can brake your SQL into very managable/readable elemental pieces</p>
<p>Disclaimer: the following, while adapted from a working example, has not itself been literally tested</p>
<p>Some reference links for the gene... | <p>Can you tell a bit more about what exactly you are planning to do.
Is it simply generating XML data based on a content of the table
or adding some data from the table to an existing xml structure?</p>
<p>There are <a href="http://www.sqlservercentral.com/Authors/Articles/Jacob_Sebastian/212008/" rel="nofollow nore... | 17,808 |
<p>So, my question is how do people get the word out that their website or blog exists? Do blogger invest in ads? Is is just through word of mouth? Or searching Google? I'm just curious how does a website build it's popularity. Do you just put your website up on the web and hope people find it? I know you can make your... | <p>The big thing is, build a good site! have good quality relevant content. SEO and page linking will help. Most search traffic comes from Google imho. I would suggest
<a href="http://www.google.com/webmasters/start" rel="noreferrer">http://www.google.com/webmasters/start</a>
Submite a sitemap would be high on my todo... | <p><a href="http://news.ycombinator.com/item?id=341138" rel="nofollow noreferrer">This thread at Hacker News</a> is a good starting point.</p>
| 30,458 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.