input
stringlengths
51
42.3k
output
stringlengths
18
55k
prototype and jQuery peaceful co-existence? <p>I know very little about JavaScript but despite this I'm trying to cobble something together on my wordpress blog. It's not working, and I don't know how to resolve it, and hey, that's what StackOverflow is for, right?</p> <p>Firstly, the error message is:</p> <pre><code...
<p>There is a nasty trick many libraries do that I've taken a distinct liking to, and it looks like prototype is one of these. </p> <p>Mootools does this, If I am right, and it involves overloading many of the prototypes on the basic classes, monkey patching them. </p> <p>And likewise, I similarly encountered strange...
Regex Named Groups in Java <p>It is my understanding that the <code>java.regex</code> package does not have support for named groups (<a href="http://www.regular-expressions.info/named.html">http://www.regular-expressions.info/named.html</a>) so can anyone point me towards a third-party library that does?</p> <p>I've ...
<p>(<strong>Update</strong>: <strong>August 2011</strong>)</p> <p>As <a href="http://stackoverflow.com/users/50260/geofflane">geofflane</a> mentions in <a href="http://stackoverflow.com/questions/415580/regex-named-groups-in-java/7033467#7033467">his answer</a> (upvoted), <a href="http://download.oracle.com/javase/7/d...
Redirect console output to textbox in separate program <p>I'm developing an Windows Forms application that requires me to call a separate program to perform a task. The program is a console application and I need to redirect standard output from the console to a TextBox in my program. </p> <p>I have no problem execu...
<p>This works for me:</p> <pre><code>void RunWithRedirect(string cmdPath) { var proc = new Process(); proc.StartInfo.FileName = cmdPath; // set up output redirection proc.StartInfo.RedirectStandardOutput = true; proc.StartInfo.RedirectStandardError = true; proc.EnableRaisingEvents = true; ...
FxCop rule that checks for NotImplementedExceptions <p>I'd like to have the nightly build check for how many NotImplementedExeptions there are in my .NET code so hopefully we can remove them all before releasing. My first thought is that FxCop might be a good tool to do this. Does anyone have a custom FxCop rule for ...
<p>Unit test like this will fail if more than 10 methods create NotImplementedException. On failing it will report all methods that create this exception.</p> <pre><code>var throwingMethods = codebase.Methods .Where(m =&gt; m .GetInstructions() .Exists(i =&gt; i.Creates&lt;NotImplementedException&g...
DataContext naming Best Practices <p>Are there any? Do you give the DataContext the name of the Database you are getting data from or..</p>
<p>Don't know if there are any established "best practices". I just name it with something that makes sense to me and lets me know immediately what it is. For me, that's to name it after the database. </p> <p>So with Northwind database I have NorthwindDataContext.</p>
Stubbing functions in simulations <p>I'm working on an embedded C project that depends on some external HW. I wish to stub out the code accessing these parts, so I can simulate the system without using any HW. Until now I have used some macros but this forces me to change a little on my production code, which I would l...
<p>I just make two files ActualDriver.c and StubDriver.c containing exactly the same function names. By making two builds linking the production code against the different objects there is no naming conflicts. This way the production code contains no testing or conditional code.</p>
Emacs and slime stopped cooperating for me <p>I'm trying to use slime from CVS (2009-01-05) but keep getting this error:</p> <pre> LOAD: A file with name /usr/share/common-lisp/source/slime/swank-loader.lisp does not exist </pre> <p>I've stripped my .emacs down to just:</p> <pre><code>(setq inferior-lis...
<p>Have you purged the slime pkg you installed via apt-get? It looks like emacs is still reading the old site-specific configuration setup by apt-get. Try starting emacs with the -Q option, which prevents loading of site-specific (as well as user specific) customization, and see if the problem still occur.</p>
SQL code import into Access 2007 <p>I basically need to know how to import SQL code into Access. I've tried one way but that requires me to do one table and one value at a time which takes a lot of time.</p> <p>Can anyone help?</p>
<p>If you are trying to import data, rather than SQL code (see Duffymo's response), there are two ways.</p> <p>One is to go where the data is and dump a .CSV file and import that, as Duffymo responded.</p> <p>The other is to create a table link from the Access database to a table in the source database. If the two ...
Modularising a C# Compact Framework 2.0 Application <p>We're currently developing a new piece of hand-held software. I cant discuss the nature of the application, so I'll use an example instead.</p> <p>We're designing hand-held software for managing a school. We want to modularise each aspect of the system so that dif...
<p>I have been in projects that have done it two ways: </p> <ul> <li><p>In one project we did not deploy certain DLLs if the customers weren't licensed. That's what you are suggesting. It worked fine. Of course, there was no way to enable those modules without an additional install, but it made perfect sense for that ...
AVM2 and ABC (Adobe's ActionScript bytecode format) spec licensing.. can I use it? <p>Google is failing me on this one.</p> <p>Let's say I have some ECMA script that I've compiled to an ABC bytecode file using the compiler in the Open Source Flex SDK.</p> <p>Is it within the terms of use (That I can't seem to find) f...
<p>Adobe open sourced the ActionScript virtual machine as a Mozilla project named <a href="http://www.mozilla.org/projects/tamarin/" rel="nofollow">Tamarin</a> under an MPL/GPL/LGPL tri-license. If I remember correctly, this source code also includes documentation for ABC bytecode. With that in mind, it seems to me tha...
Adding a License to your .Net Web Application <p>I am currently looking at adding some licensy type software which will protect my .net web application source code. Was wondering if you guys had any experience with this and knew perhaps any companies or sources which provide such utilities ?</p> <p>So my main aim is t...
<p>One step you can do is to release it as a Web Application rather than a Web Site.</p> <p><a href="http://weblogs.asp.net/anasghanem/archive/2008/07/13/differences-when-registering-httpmodules-and-httphandlers-for-web-application-projects-and-website-project.aspx" rel="nofollow">Differences here from asp.net</a></p>...
TFS shows some pending changes under my name, but I have not changed anything <p>TFS shows some pending changes under my name, but I have not changed anything. When I check in and see View Pending changes, I see some of the changes which I have never made, changes pending under some other user might be shown as my pend...
<p>This is probably due to the automatic checkout feature in TFS.</p> <p>TFS uses an atomic check-in process and is very careful about recording who did what. When you start editing a file (or the IDE edits one on your behalf, for example a .csproj or .vbproj file) then the file will show up in your pending changes l...
What is the best way to track memory management while testing my iPhone App? <p>While developing my app I have come to realize that the majority of my app crashes have arisen from poor memory management.</p> <p>I understand I can print or log retain counts through NSLog (@"retain count is:%d",[myInstance retainCount])...
<p>Use the Leaks and Object Allocation tools through XCode.</p> <pre><code>Run &gt; Start with Performance Tool &gt; ... </code></pre>
Get image properties with Jython <p>I am using Jython to move images around and organise them. I would like to extract some information from the images like dimensions and file size.</p> <p>How would I go about doing this with Jython?</p> <p>Cheers</p>
<p><a href="http://www.pythonware.com/products/pil/" rel="nofollow">Python Image Library</a>.</p>
JavaScript detection of keypress context (form history selection vs. form submit) <p>I'm writing a semi-generic form plugin using jQuery in order to speed up the development of the project I'm working on.</p> <p>The plan is that a <a href="http://jtemplates.tpython.com/" rel="nofollow">jTemplates</a> template contains...
<p>I have found that in order to prevent the default action for an [enter] or [tab] key event you have to listen for the keydown event and handle/cancel it.<br> By the time keyup or keypress is triggered the default for keydown has already happened.</p>
How do I deny access to .dll files in a web site (on both IIS 6 and 7) <p>If I use an URL like <a href="http://mysite/myfolder/myfile.dll" rel="nofollow">http://mysite/myfolder/myfile.dll</a>, I get a dialog "Do you want to open or save this file". Of course, I don't want people to be able to download and disassembly ...
<p>Usually this is disallowed by default. If you go into the IIS manager and edit the website, you need to uncheck 'script source access.' DLL should also be on the list of forbidden file extensions.</p>
Using API/Function calls or going for the Cron Job approach - An inquiry into dealing with transactions - How would you handle it? <p>I wanted to run something by you guys. I am starting a new project which is roughly the following:</p> <p>Important information: I am using PHP and MySQL</p> <p>Every minute I get a li...
<p>If you want to do it using the bare minimum variance from your current technology stack you're on the right track. Essentially you're re-creating a bare bones MQ or job server.</p> <p>Minimum features you need for job/task/transaction queue are:</p> <ul> <li>the job (user1 send $2 to user2)</li> <li>the state (re...
Fetch mail attachment into SQL Server 2005 using IMAP <p>I need to import data into my SQL Server 2005 from an e-mail datasource on an Exchange mail server. It means that when a mail is sent to a particular mail address I must retrieve the mail subject and the attached file and then I must import these data into my SQL...
<p>In case anybody is interested: I solved the problem myself using an open source IMAP library which I included in a Windows Service. I did not use SSIS anyway because SSIS in SQL Server 2005 does not support the IMAP interface.</p> <p>The open source IMAP library is called "Koolwired.IMAP".</p> <p>Here are some lin...
String Comparison : individual comparison Vs appended string comparison <p>I have six string variables say str11, str12, str13, str21, str21 and str23.</p> <p>I need to compare combination of these variables.</p> <p>The combinations I have to check is str11 -- str12 -- str13 as one group and str21 -- str22 -- str23 a...
<p>I’d test individually.</p> <p>Is “AB” “CD” “EF” equal to “ABC” “DE” “F”?</p> <p>Me thinks not.</p> <p>P.S. If it is, then it’s a VERY special case, and if you decide to code it that way (as a concatenated comparison) then comment the hell out of it.</p>
Java map with values limited by key's type parameter <p>Is there a way in Java to have a map where the type parameter of a value is tied to the type parameter of a key? What I want to write is something like the following:</p> <pre><code>public class Foo { // This declaration won't compile - what should it be? ...
<p>You're not trying to implement Joshua Bloch's typesafe hetereogeneous container pattern are you? Basically:</p> <pre><code>public class Favorites { private Map&lt;Class&lt;?&gt;, Object&gt; favorites = new HashMap&lt;Class&lt;?&gt;, Object&gt;(); public &lt;T&gt; void setFavorite(Class&lt;T&gt; klass, T t...
On Windows XP, how do I enumerate all the windows displayed by the system (C#) <p>I would like to end up with a list (or array or whatever) of all the visible (including minimised) windows. </p> <p>I have found 2 similar questions, which don't <em>quite</em> give me what I'm looking for:<br /> - <a href="http://stack...
<p>I think that the blog entry by Raymond Chen pointed to in the first link gives you an idea of where you want to go. Basically, you would call EnumWindows and then apply that algorithm, except that you would take note of every window handle that is visible.</p> <p>The question is a little vague, what is the purpose...
Problem with SQL Join <p>I have two tables, tblEntities and tblScheduling.</p> <p>tblEntities:</p> <pre><code>EntityID ShortName Active 1 Dirtville 1 2 Goldtown 1 3 Blackston 0 4 Cornfelt 1 5 Vick 1 </code></pre> <p...
<p>Try this... Join conditions are evaluated to produce the intermediate Join result set, and then, (for an outer join), all the rows from the "Outer" side are added back in before moving on... Where conditions are evaluated after all joins are done... </p> <pre><code>SELECT E.EntityID, E.ShortName, S.ScheduleID FROM...
How to organize the controller of a MVC-based program with multiple screens/panels? <p>I'm currently working on a hobby project, written in Java, containing about two different JFrames with about 3-4 JPanels each. The problem I'm facing is that I'm not so sure how to handle the interaction with my controller and differ...
<p>Even though Markus' solution remains the neatest I've seen so far, I've made some slight changes, which are hopefully improvements in the eyes of the original author as well ;).</p> <p>In case you add/remove an item of the list in response to an event, there is a chance of ending up with concurrent changes to the l...
Getting a Signature Mismatch Error when Compiling Even though it Matches in VS.NET 2005 <p>I changed a reference in my project from pointing to a specific hard-coded DLL to a project reference and now I'm getting an error telling me that the signature for some event handlers don't match even though they do.</p> <p>Her...
<p>Are the compiled dll, its respective project, and the user project all referencing the same version of the Infragistics assemblies? From what I've seen, any time you have a signature that appears to match, an error like this means you are referencing two different versions of an assembly and attempting to use one i...
Can Hibernate return a collection of result objects OTHER than a List? <p>Does the Hibernate API support object result sets in the form of a collection other than a List? </p> <p>For example, I have process that runs hundreds of thousands of iterations in order to create some data for a client. This process uses recor...
<p>If I understand correctly, you load a bunch of data from the database to memory and then use them locally by looking for certain objects in that list.</p> <p>If this is the case, I see 2 options.</p> <ol> <li>Dont load all the data, but for each iteration access the database with a query returning only the specifi...
XmlSerializer, sgen.exe and generics <p>I have a generic type:</p> <pre><code>public class Packet&lt;T&gt; where T : IContent { private int id; public int Id { get { return this.id; } } private T content; public T Content { get { return this.content; } } } </code></pre> <p>I want to deserialize/seria...
<p>Yes, you can implement a custom class directly with IXmlSerializable. <br/> For more information, see <a href="http://msdn.microsoft.com/en-us/library/system.xml.serialization.ixmlserializable.aspx" rel="nofollow">this</a> article.</p>
ASP.NET MVC - Mapping more than one query string parameter to a pretty url <p>I am a bit stuck on the design of my seo friendly urls for mvc....Take for example the following url: <a href="http://myapp/venues/resturants.aspx?location=central&amp;orderBy=top-rated" rel="nofollow">http://myapp/venues/resturants.aspx?loca...
<p>Click on your <a href="http://stackoverflow.com/users/52065/wololo">profile link</a> and look at the URLs for Stats, Recent, Response, etc.</p> <p>Examples:</p> <ul> <li><a href="http://stackoverflow.com/users/52065?sort=recent#sort-top">http://stackoverflow.com/users/52065?sort=recent#sort-top</a></li> <li><a hre...
Can I Use a .NET DLL in "Delphi 2007 for Win32"? <p>Is it possible to use a .NET DLL in Delphi 2007 for Win32? I've tried to import the DLL in the same way I've done for an ActiveX component, but it doesn't appear to work (Component Menu -> Import Component -> Import .NET Assembly.</p> <p>Is it possible and if so wha...
<p>If you want a Delphi specific article on doing that:</p> <p><a href="http://dn.codegear.com/article/32754">Using a .NET Assembly via COM by Jim McKeeth</a> </p> <p>It is pretty straight forward once you have all the steps.</p>
Trigger and control inside DetailView <p>I have a DetailsView control with a LinkButton inside the TemplateField. </p> <p>I wrap the DetailsView inside the UpdatePanel and set trigger with the LinkButton inside the DetailsView . However, i got error saying it can't find the LinkButton. I tried to google on setting tri...
<p>i find my answer. Basically set ChildrenAsTriggers to true in updatepanel. Any control inside the update panel will trigger it.</p>
Scaffolding ActiveRecord: two columns of the same data type <p>Another basic Rails question:</p> <p>I have a database table that needs to contain references to exactly two different records of a specific data type.</p> <p>Hypothetical example: I'm making a video game database. I have a table for "Companies." I want t...
<p>Just to tidy things up a bit, in your migration you can now also do:</p> <pre><code>create_table :videogames do |t| t.belongs_to :developer t.belongs_to :publisher end </code></pre> <p>And since you're calling the keys developer_id and publisher_id, the model should probably be:</p> <pre><code>belongs_to :dev...
HTML special code to ASCII <p>Hey, is there any built in functions or something like that in php that will allow me to turn HTML special code like: &lt;(;), >(;), Á(;) and ©(;) etc... into &lt;, >, Á and ©</p> <p>Lets say I have the value: </p> <pre><code>$fileName = "Gibt es eine schö(;)ne Offroadstrecke? (;)";...
<p>I think you want <a href="http://uk3.php.net/manual/en/function.html-entity-decode.php" rel="nofollow">html_entity_decode</a> </p>
WatiN or Selenium? <p>I'm going to start building some automated tests of our presentation soon. It seems that everyone recommends <a href="http://watin.sourceforge.net/index.html">WatiN</a> and <a href="http://seleniumhq.org/">Selenium</a>. Which do you prefer for automated testing of ASP.NET web forms? Why did that p...
<p>Just want to say that I'm currently working hard on a beta release of WatiN 2.0 somewhere in Q1 of 2009. It will be a major upgrade to the current CTP 2.0 versions and will basically give you the same functionality to automate FireFox and IE as version 1.3.0 offers for automating IE.</p> <p>So no concerns there.</p...
Why is the regex replace method not working? <p>In the following code I want to replace every occurrence of <code>"U.S.A"</code> with <code>"united states of America"</code> and every occurrence of <code>"uk"</code> with <code>"united kingdom"</code> in a string, but it does not seem to work. How do I fix it? </p> <pr...
<p>Well, look at the search pattern in your regex.</p> <p>The <code>^</code> has a specific meaning. (as do the <code>.</code> but they won't actually fail in this case, but they aren't doing what you think they are)</p>
Install Shield 2009 - Shortcuts creation <p>Is it possible to create shortcuts in Install Shield 2009 based on user input? In essnes, a shortcut will be created (on the desktop) only if the user (who runs the installation) wants to do so</p>
<p>We have a screen that prompts the user to create desktop and quicklaunch shortcuts.</p> <p>The shortcuts are then each in individual components with a condition set to only install if the checkbox was selected.</p> <p>You also should store this response in the registry somewhere, and read it back during a reconfig...
Hide certain actions from Swing's undo manager <p>I am trying to write a JTextPane which supports some sort of coloring: as the user is typing the text, I am running some code that colors the text according to a certain algorithm. This works well.</p> <p>The problem is that the coloring operations is registered with t...
<p>How are you trying to prevent the CHANGE events from reaching the undo manager?</p> <p>Can you not send the UndoManager a lastEdit().die() call immediately after the CHANGE is queued?</p>
Edit HTML Meta Tag w/ ASP.NET <h3>Question</h3> <p><hr /> Hello All,</p> <p>I'm trying to build a quick and easy ASP.NET page that redirects a user to a new URL using a meta redirect. Only trouble is that I need to also pass along the GET values of the current request. I've found a way to do this programatically in...
<p>Maybe this code inside the head tag will be what you need:</p> <pre><code>&lt;%= string.Format("&lt;meta http-equiv='refresh' content='10;url=http://contact.test.net/main.aspx?{0}' /&gt;", Request.QueryString.ToString()) %&gt; </code></pre> <p><strong>However</strong>, I wouldn't advise you to do it this way. For ...
jQuery UI Tabs - How to Select a Tab on Hover <p>Using the jQuery UI Tabs component, is it possible to select new tabs on hover instead of when clicking on them?</p> <p>I found an example <a href="http://stilbuero.de/jquery/tabs/mouseover.html" rel="nofollow">here</a>, but this does not seem to work with the latest (s...
<p><a href="http://ui.jquery.com/demos/tabs#mouseover" rel="nofollow">demo here</a> Its running with 1.6rc4 which I consider as stable as any other of the ui releases!</p>
Abstract classes and methods in Java, Inheritance <p>I have class B, which inherits from class A. The superclass A is abstract, containing one abstract method. I don't want to implement the abstract method in class B, therefore I need to declare class B as abstract as well. Declaring class B abstract, two things are wo...
<p>In Java, the <code>abstract</code> class annotation indicates that the class cannot be directly instantiated. A class could be declared <code>abstract</code> simply because it should never be instantiated (perhaps it contains only static methods), or because its subclasses should be instantiated instead.</p> <p>It...
Classic ASP: Server.CreateObject not supported <p>When I call Server.CreateObject(), from my Classic ASP page, I get</p> <pre><code>Microsoft VBScript runtime (0x800A01B6) Object doesn't support this property or method </code></pre> <p>I've tried the following (separately):</p> <pre><code>Server.CreateObject("Micros...
<p>If you do the following:</p> <pre><code>Dim x: x = Server.CreateObject("My.ProgID.Here") </code></pre> <p>...VBScript creates the object and then attempts to access the default property for storing in 'x'. Since none of these objects have a default property defined (specifically an IDispatch-based property with [i...
How to right align a <p> tag? <p>I have a couple of <code>&lt;p&gt;</code> tags that I want to right align. Does anyone know how to do this?</p>
<p>CSS:</p> <pre><code>p { text-align: right; } </code></pre> <p>INLINE:</p> <pre><code>&lt;p style="text-align: right"&gt;Some Text&lt;/p&gt; </code></pre> <p>jQuery:</p> <pre><code>$('p').css('text-align', 'right'); </code></pre> <p>Javascript:</p> <pre><code>var aElements = document.getElementsByTagName('...
SVN export just the changed files from tags <p>Does anyone know how to export only the changed files from two tags using svn? </p> <p>Lets say I have tag 1.0 and then later fix bugs in the trunk. Next I am ready for a new patch release so I tag it 1.1. Now I want to export the changed files between tag 1.0 and 1.1. ...
<p>svn diff --summarize url/to/tag1.0 url/to/tag1.1</p> <p>will give you a list of files that changed between those two tags. You should be able to parse that list in a script and export each file individually with either</p> <p>svn export url/to/file filepath</p> <p>or</p> <p>svn cat url/to/file > file</p> <p>If ...
What's your naming convention for helper functions? <p>In functional programming, it's often important to optimize any "looping" code to be tail recursive. Tail recursive algorithms are usually split between two functions, however - one which sets up the base case, and another that implements the actual loop. A good (a...
<p>You can call the helper function anything you want, and it won't matter as long as you don't put the helper function in the "global" namespace. Simply adding a "prime" seems a common practice. :) E.g., in Haskell,</p> <pre><code>reverse :: [a] -&gt; [a] reverse = reverse' [] where reverse' :: [a] -&gt; [a] -&gt...
What problems are easy to spot in a dependency graph? <p>What are the things I should be looking for when I produce a dependency graph?</p> <p>Or to put it another way, what are the characteristics of a good looking graph vs a bad one?</p> <p>Edit: The context here is my first look at my assemblies in NDepend.</p>
<p>a dependency graph of what? classes? stored procedures?</p> <p>cycles are bad...</p>
Implementing IInternetZoneManager in .NET <p>I'm trying to implement <a href="http://msdn.microsoft.com/en-us/library/ms537079(VS.85).aspx" rel="nofollow">IInternetZoneManager</a> in .NET with Webbrowser Control but I have no clue what to do.</p> <p>I couldn't find any managed code example about this implementation. I...
<p>This is what I get when I convert it:</p> <pre><code>public class Constants { public const int MAX_PATH = 260; public const int MAX_ZONE_PATH = 260; public const int MAX_ZONE_DESCRIPTION = 200; } [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)] public struct ZONEATTRIBUTES { public ui...
Practices to prevent/control image content <p>Dead code is easily recognised and eliminated by having code reviews, however, when it comes to images - unused images still get into our version control. Is there any clean way of organising graphic content so that a direct correlation exists between web pages and image fi...
<p>You could walk the website with a crawler (like wget) and remove any image not touched (i.e. not listed in your logs.)</p> <p>A quicker way would be to just dump all the image file names found in your code.</p> <pre><code>grep -o -e \w*?\.png (caution: untested regex) </code></pre>
How to reverse lines of a text file? <p>I'm writing a small shell script that needs to reverse the lines of a text file. Is there a standard filter command to do this sort of thing?</p> <p>My specific application is that I'm getting a list of Git commit identifiers, and I want to process them in reverse order:</p> <p...
<p>In <a href="http://www.gnu.org/software/coreutils/">GNU coreutils</a>, there's <a href="http://www.gnu.org/software/coreutils/manual/coreutils.html#tac-invocation">tac(1)</a></p>
How "safe" are Anonymous Types and Reflection together? <p>I guess this could also be asked as to how long the created type name is attached to an anonymous type. Here's the issue:</p> <p>A blog had something like this:</p> <pre><code>var anonymousMagic = new {test.UserName}; lblShowText.Text = lblShowText ...
<p>It never does. The type is generated at compile-time and you can consider it constant and unique throughout the life of the app-domain.</p> <p>I question the value of this function though. The obvious first reason is because you don't have much of the functionality of the Format method on the String class (no esc...
Any drawbacks or gotchas to using Jinja2 templates in Django? <p>After reading the Jinja2 documentation, I'm interested in employing it in future Django projects. However, I'm wondering if anyone has encountered any drawbacks or gotchas when using Jinja2 templates with Django? If so, how did you work around them?</p>...
<p>I use Jinja2 in some of my projects and love the extra expressiveness it gives me. I can keep my presentation logic and application logic separate, but I don't have to bend over backwards to call into a function/method I've designed specifically for my presentation layer.</p> <p>In addition to what's already been ...
Transaction Scope <p>How does the transaction scope work? How does it know when there is another context being used already and how might I implement another kind of scope in my code.</p> <p>I'm primarily a vb.net developer but I can read the c# if you write in that.</p> <p>In case the above was too vague:</p> <p>I...
<p>I suggest the article <a href="http://msdn.microsoft.com/en-us/library/ms973865.aspx">Introducing System.Transactions</a> by <a href="http://www.idesign.net/idesign/DesktopDefault.aspx?tabindex=3&amp;tabid=5">Juval Lowy</a></p>
Setting iso-8859-1 instead of utf-8 in oscommerce / sts template website? <p>In an oscommerce site I have the following:</p> <p>Server response = Content-type: text/html;charset=UTF-8</p> <p>and I want: Content-type: text/html;charset=ISO-8859-1</p> <p>How and where do I set this up. </p> <p><hr /></p> <p>Html lo...
<p>in an .htaccess file</p> <pre><code>AddDefaultCharset ISO-8859-1 </code></pre>
Subdirectories within an iOS application <p>Is there a way to have directories within an .app?</p> <p>At the moment if I add a file into Xcode, regardless of what Group hierarchy it is in, the file always lands in a flat filesystem within my application bundle.</p>
<p>If you just want to copy existing files into your application bundle's Resources folder (which on iPhone is just the inside of the .app bundle), do the following:</p> <ul> <li>Drag the folder you want copied into the Files and Folders listing of your xcode project.</li> <li>From the sheet that pops up asking you if...
All .cpp files depend on two .h files? <p>In a makefile, I have the following line:</p> <pre><code>helper.cpp: dtds.h </code></pre> <p>Which ensures that helper.cpp is rebuilt whenever dtds.h is changed. However, I want ALL files in the project to be rebuilt if either of two other header files change, kind like this:...
<p>Try</p> <pre><code>%.cpp : h1.h h2.h </code></pre> <p>That works in GNU make - no idea if nmake is compatible...</p> <p><strong>Edit:</strong> And btw: shouldn't that be</p> <pre><code>helper.o : dtds.h %.o : h1.h h2.h </code></pre> <p>After all, you don't want to remake the <code>.cpp</code> file (how do you...
What is a good openid selector control? <p>Now that <a href="http://www.idselector.com/">idselector</a> has been upgraded to <a href="http://rpxnow.com/">RPXNow</a> and you can't "just use" the selector code, what is a good replacement?</p> <p>I want to implement OpenId on a new website that I am using, but the users ...
<p><a href="http://jvance.com/pages/JQueryOpenIDPlugin.xhtml"><strong>Jarrett Vance</strong> </a> made a "version" of open-selector that is much more developer/designer friendly.</p> <blockquote> <p>This selector is different because <strong>it does not hide the markup details in javascript</strong>. Therefore, <st...
cloning ExtJS components using JQuery <p>I'm trying to clone form components using JQuery's .clone() (actually, I'm cloning a collection of fields by cloning the container element). Everything worked out well except that the datefield, comboboxes are not working, even the validation for minLength, etc. is also not work...
<p>The problem is that jQuery clone() does not clone the event handlers associated with DOM elements. But even if you use clone(true), that does copy the event handlers, it still doesn't work, because you also need to clone the Ext object on the JavaScript side.</p> <p>You really need to use the tools provided by Ext ...
Managing and debugging SQL queries in MS Access <p>MS Access has limited capabilities to manage raw SQL queries: the editor is quite bad, no syntax highlighting, it reformats your raw SQL into a long string and you can't insert comments.</p> <p>Debugging complex SQL queries is a pain as well: either you have to split ...
<p>For debugging, I edit them in a separate text editor that lets me format them sensibly. When I find I need to make changes, I edit the version in the text editor, and paste it back to Access, never editing the version in Access.</p> <p>Still a major PITA.</p>
Why doesn't CakePHP support a foreign key with multiple columns? <p>I searched in google for this without a good result. The only <a href="https://trac.cakephp.org/ticket/1923" rel="nofollow">topic</a> I found in the CakePHP trac, was closed without a "real" explanation. Since CakePHP is like one of the rails ports for...
<p>Only the CakePHP team would know for sure. One of the team, Nate Abdele, <a href="http://groups.google.com/group/cake-php/msg/255c641339eef6ac" rel="nofollow">said this</a> about multi-column primary keys back in February 2007:</p> <blockquote> <p>I could come up with a million other reasons why multi-column p...
How to raise an exception on the version number of a module <p>How can you raise an exception when you import a module that is less or greater than a given value for its __version__?</p> <p>There are a lot of different ways you could do it, but I feel like there must be some really simple way that eludes me at the mom...
<p>Python comes with this inbuilt as part of distutils. The module is called <code>distutils.version</code> and is able to compare several different version number formats.</p> <pre><code>from distutils.version import StrictVersion print StrictVersion('1.2.2') &gt; StrictVersion('1.2.1') </code></pre> <p>For way mor...
How to get JavaScript function data into a PHP variable <p>I am using PHP and JavaScript. My JavaScript code contains a function, get_data():</p> <pre><code>function get_Data(){ var name; var job; ..... return buffer; } </code></pre> <p>Now I have PHP code with the following.</p> <pre><code>&lt;?php...
<p>Use jQuery to send a JavaScript variable to your PHP file:</p> <pre><code>$url = 'path/to/phpFile.php'; $.get($url, {name: get_name(), job: get_job()}); </code></pre> <p>In your PHP code, get your variables from <code>$_GET['name']</code> and <code>$_GET['job']</code> like this:</p> <pre><code>&lt;?php $buff...
Grabbing text from a webpage <p>I would like to write a program that will find bus stop times and update my personal webpage accordingly.</p> <p>If I were to do this manually I would </p> <ol> <li>Visit www.calgarytransit.com</li> <li>Enter a stop number. ie) 9510</li> <li>Click the button "next bus"</li> </ol> <p>T...
<p><a href="http://www.crummy.com/software/BeautifulSoup/documentation.html#Quick%20Start" rel="nofollow">Beautiful Soup</a> is a Python library designed for parsing web pages. Between it and <a href="http://docs.python.org/library/urllib2.html" rel="nofollow">urllib2</a> (<a href="http://docs.python.org/py3k/library/u...
VS2008: Running xsd.exe on schema file gives XMLSchema:datetime is not declared <p>I have a an XSD that looks like this (roughly)</p> <pre><code>&lt;xs:schema id="Appointment" targetNamespace="http://tempuri.org/Record.xsd" elementFormDefault="qualified" attributeFormDefault="qualified" xmlns="http://tempuri.org/Recor...
<p>Bah, nevermind. </p> <p>Was case sensitivity issue.</p> <p>The correct form to use was</p> <pre><code>xs:dateTime </code></pre> <p>instead of</p> <pre><code>xs:datetime </code></pre>
How do I get the number of rows per day between given dates? <p>I am having table in the below format. I need mysql query to get the no of rows perday when i give date between 2008-10-12 and 2008-10-13</p> <pre> Name | KW | KV | I | Date | ------+--------+------+------+---------------------+ ...
<p>I have changed the query so that Date column case matches exactly what you have in your query results.</p> <pre><code>select Date, count(Date) from TABLE where Date &gt;= '2008-10-12' and Date &lt;= '2008-10-13' group by Date </code></pre> <p>You will need to change TABLE in the from clause, but everything else sh...
Binary SMS in Symbian <p>I wonder if anyone has managed to create a working code for sending out binary messages (to configure Symbian phones) and have also some binary data sample. So far all the samples I have found fail to leave the Outbox or never return.</p> <pre><code>// Current entry is the Draft folder. iS...
<p>Use the JSR120 specification and the wireless toolkit. they contain java example code that will work for sure.</p> <p>These are implemented directly using RSocket objects in Symbian C++.</p> <p>If you really want to do it in C++, the simplest way is to copy your TMsvEntry to the entry of the sms service. In your c...
How do I pan the image inside a UIImageView? <p>I have a <code>UIImageView</code> that is displaying an image that is wider and taller than the <code>UIImageView</code> is. I would like to pan the image within the view using an animation (so that the pan is nice and smooth).</p> <p>It seems to me that I should be able...
<p>I'd highly recommend enclosing your <code>UIImageView</code> in a <code>UIScrollView</code>. Have the <code>UIImageView</code> display the full image, and set the contentSize on the <code>UIScrollView</code> to be the same as your <code>UIImageView's</code> size. Your <code>window</code> into the image will be the...
increase clarity of a graph <p>I am using jfreechart for plotting graphs. The problem is that if have more entries on the X-axis, then the X-axis parameters are not visible. How should I solve that?</p>
<p>Change the scale of the graph until you can see the parameters. </p>
What are the rules for file extensions in Windows and Unix? <p>i'm currently using File::Basename fileparse to separate out a file's directory, base file name and it's extension using something like this:</p> <pre><code>my($myfile_name,$mydirectory, $file_extension) = fileparse($$rhash_params{'storage_full_path_locati...
<blockquote> <p><code>1</code>. Is there a list of commonly used extension for Windows and Unix systems? But in my case it's mainly for Windows.</p> </blockquote> <p>Yes, loads, all over the internet: <a href="http://www.google.com/search?q=common+file+extensions" rel="nofollow">http://www.google.com/search?q=co...
Does location.replace() not do a conditional get if last-modified caching is in place? <p>Here's what I'm seeing: I have a conditional-get caching policy in place (cache-control: private, must-revalidate).</p> <p>It works fine if I'm on the page, then try to hit the browser's refresh button.</p> <p>However, in anothe...
<p>you can force an uncached version by doing <code>location.replace(url + "?tid=" + Math.random())</code></p>
Digitally sign pdfs <p>My company has a web document management application and I have been assigned to find a way to sign pdf files with the user digital certificate.</p> <p>The pdfs can go from a few kb to over 100Mb, this is over the internet so the signature <strong><em>must</em></strong> take place at the web ser...
<p>You want the user to upload their certificate's private key to the webserver so that it may sign PDFs? If so, that's fundamentally broken from a security perspective.</p> <p>I think you may have missed the point that public certificate != private key. (Most of us are sloppy and use the word "certificate" to refer t...
Post from one controller action to another (not redirect) <p>I have an action which I need to post forward onto another action if it meets certain conditions, but I am unable to preserve the form data when passing through to the next action.</p> <p>The receiving action accepts a FormCollection, which the sending actio...
<p>I would refactor the two controllers and put the common code into a helper or into a common base class. That way the actions in the two controllers can delegate to the common code.</p>
Java: Receive a multipart HTTP response <p>I'm writing a Java client application to receive live M-JPEG video from an IP camera. The video is sent by the camera as an endless multipart HTTP message where each part is a single JPEG frame. I need to process each of these frames as they arrive, so I'm hoping there's a way...
<p>This project: <a href="http://fmj-sf.net/" rel="nofollow">http://fmj-sf.net</a>, does have a class to parse multipart/x-mixed-replace responses: <a href="http://fmj-sf.net/doc/fmj/net/sf/fmj/media/parser/MultipartMixedReplaceParser.html" rel="nofollow">http://fmj-sf.net/doc/fmj/net/sf/fmj/media/parser/MultipartMixed...
‘Remember Me’ Login in CodeIgniter <p>How do you implement this in CodeIgniter?</p>
<p><em>(This answer was a response to the original question)</em></p> <blockquote> <p><em>How would you do this ? Or, how would you create a session with a longer expiration date than the others ?</em></p> <p>*All created sessions would use the same $config['sess_expiration'] in the config file (default...
How to change the row position of virtual mode DataGridView? <p>How to change the row position of virtual mode DataGridView?</p> <p>I am using <a href="http://en.wikipedia.org/wiki/Windows%5FForms" rel="nofollow">Windows Forms</a>.</p>
<p>You have to clear the old position and set a new one</p> <p>The collection dataGridView1.SelectedRows has the current selected Rows. Depending on the MultiSelect property of the grid you may have to loop through all the rows in the SelectedRows and mark them as unselected. If you are single selection mode, just set...
Postback destroys user controls in my GridView columns <p>I have a ASP.NET GridView that uses template columns and user controls to allow me to dynamically construct the datagrid. Now I'm implementing the event handler for inserting a row. To do that, I create an array of default values and add it to the data table whi...
<p>You have to add the controls to the grid on every page_load, not just if it's (!Postback)</p>
How do I avoid unwanted log messages on java project? <p>On my java project, I have a bunch of strings externalized on a <code>messages.properties</code> file. On its respective <code>Messages.java</code> file I had the same number of public static String-typed attributes, so I could access those externalized texts. ...
<p>Your <code>Messages</code> class - it sounds like it extends <code>org.eclipse.osgi.util.NLS</code>.</p> <p>If this is the case, it is designed to fill the requirements:</p> <ul> <li>to provide compile time checking that a message exists.</li> <li>to avoid the memory usage of a map containing both keys and values ...
Loop through PageField in OLAP Cube [PivotTable] <p>I'm trying to write a VBA script that will draw buttons beside the <code>PageFields</code> in a Pivot Table, these buttons will loop through the values in the <code>PageField</code>. I had this working for a regular Pivot Table, but I've been asked to adapt it for an ...
<p><a href="http://msdn.microsoft.com/en-us/library/aa140054.aspx" rel="nofollow">This MSDN Link</a> (Extending OLAP Functionality) has quite a few VBA code snippets showing how to use the pivot table API.</p>
Lisp: Need help getting correct behaviour from SBCL when converting octet stream to EUC-JP with malformed bytes <p>The following does not work in this particular case, complaining that whatever you give it is not a character.</p> <pre><code>(handler-bind ((sb-int:character-coding-error #'(lambda (c) ...
<p>There's an expression in SBCL 1.0.18's <code>mb-util.lisp</code> that looks like this:</p> <pre><code>(if code (code-char code) (decoding-error array pos (+ pos bytes) ,format ',malformed pos)) </code></pre> <p>I'm not very familiar with SBCL's internals, but this looks like a bug. The...
Source for useful EC2 AMIs <p>Using Amazon's own <a href="http://developer.amazonwebservices.com/connect/entry.jspa?externalID=552&amp;categoryID=187" rel="nofollow">client libraries</a> (or <a href="http://code.google.com/p/typica/" rel="nofollow">alternatives</a>), you can get listings of available pre-packaged AMIs,...
<p>This is a <a href="http://developer.amazonwebservices.com/connect/kbcategory.jspa?categoryID=101" rel="nofollow">list</a> of shared AMIs. I am afraid that you can't automatically search the list by a keyword in the title or the description.</p>
C++ ctor question (linux) <ul> <li><p>environment: linux, userspace-application created via g++ from a couple of C++ files (result is an ELF)</p></li> <li><p>there is a problem (SIGSEGV) when traversing the constructor list </p></li> </ul> <pre> ( __CTOR_LIST__ ) </pre> <p>(note: code called via this list is a ki...
<p>There are many possible reasons of this. Ranges from that you access objects not yet created (because order of creation of objects across different translation units is undefined) which i think is quite probable in this case, and ranges to an error on your build-environment. </p> <p>To make a own function be called...
Why do some URLs contain both numeric id and name? <p>I am wondering why the link to profile looks like: </p> <pre><code>http://stackoverflow.com/users/ID/NAME </code></pre> <p>not simply:</p> <pre><code>http://stackoverflow.com/users/ID </code></pre> <p>or even better:</p> <pre><code>http://stackoverflow.com/user...
<p>All SO-URLs are of the form id/description where the ID is unique and the description is optional. So <a href="http://stackoverflow.com/users/12890/arne.burmeister"><code>/users/12890/arne-burmeister</code></a> is the same as <a href="http://stackoverflow.com/users/12890/huhu"><code>/users/12890/huhu</code></a> and ...
How can I substitute regexp matches and map the substitutions in Perl? <p>I.e.:</p> <pre><code>echo H#97llo | MagicPerlCommand </code></pre> <p>Stdout:</p> <pre><code>Hallo </code></pre> <p>were MagicPerlCommand is something like </p> <pre><code>perl -pnle "s/#(\d+)/chr(\1)/ge" </code></pre> <p>(but that doesn't ...
<p>Change <code>\1</code> to <code>$1</code> in your MagicPerlCommand. The <code>\digit</code> backreference style doesn't t work when the replacement expression is evaluated (i.e. <code>s///e</code>).</p> <p>That worked for me on Windows and Linux.</p>
Why did the designers of ColdFusion decide to index arrays from 1 rather than 0? <p>I'm just curious about this really, does anyone know why they broke convention on this one? </p> <p>Thanks, Ciaran</p>
<p>@Cory: You'd be surprised to know who lurking on StackOverflow. :-)</p> <p>You are very much right. The original design of CFML was to allow non-programmers to build complex web applications. ColdFusion\CFML was the first language designed specifically for building web applications. Back in 1995 the web was mostly ...
SQL 2005: should I roll my own log shipping? <p>I'm looking into using log shipping for disaster recovery and I'm getting mixed messages about whether to use the built-in stuff or roll my own. Which do you recommend, please, and if you favour rolling your own what's wrong with the built-in stuff? If I'm going to reinve...
<p>There's really two parts to your question:</p> <ol> <li><p>Is native log shipping good enough?</p></li> <li><p>If not, whose log shipping should I use?</p></li> </ol> <p>Here's my two cents, but like you're already discovering, a lot of this is based on opinions.</p> <p>About the first question - native log shipp...
Guidelines for Using Brushes and Pens <p>How expensive is it to create gdi brushes and pens? Should I create them on an add needed basis and wrap them in a using so they are disposed quickly, or should I create a static class similar to System.Drawing.Brushes class?</p>
<p>IMO, they're efficient enough that you should usually not create long-lived instances that are used over several method calls, but inefficient enough that you should create each one only once within a particular method, instead of creating a new one each time you need to draw something.</p> <p>In other words, don't...
How to store IPv6-compatible address in a relational database <p>How do I do that?</p> <p>Right now, IPv6 will not be used, but I need to design the application to make it IPv6-ready. It is necessary to store IP addresses and CIDR blocks (also BGP NLRI, but this is another story) in a MySQL database. I've alway used a...
<p>I'm not sure which is the <em>right</em> answer for MySQL given that it doesn't yet support IPv6 address formats natively (although whilst "<a href="http://dev.mysql.com/worklog/task/?id=798" rel="nofollow">WL#798: MySQL IPv6 support</a>" suggests that it was going to be in MySQL v6.0, current documentation doesn't ...
Primary servers in capistrano <p>I have a task in capistrano wherein I want just a single line to run only if the server is a marked as primary. Is there a variable or method that I can reference inside a task? 'primary?' or 'primary' doesn't seem to work.</p> <p>I've also tried something akin to the following:</p> ...
<p>I've solved the issue, but it wasn't pretty. The thing that I've found is that you need to use the 'primary => true' on a per-task basis. Looking at the code, it appears that capistrano generates a list of the servers that the task will be run on before the task is run.</p>
Superscript underline in IE <p>I'm going to be brief because I'm short on time, so I apologize if this isn't as detailed as I'd like it to be.</p> <p>I have some code:</p> <pre><code>print("&lt;a href='#'&gt;Some text&lt;sup&gt;&amp;reg;&lt;/sup&gt; some more text&lt;/a&gt;"); </code></pre> <p>In FF, this works like...
<p>The <code>&lt;sup&gt;</code> tag isn't great for things like trademark and reg symbols.</p> <p>I prefer doing it with css:</p> <pre><code>&lt;span style='font-size:75%;vertical-align:super;text-decoration:none'&gt;&amp;reg&lt;/span&gt; </code></pre> <p>If you can set up a .reg class:</p> <pre><code>.reg { fo...
Initialize multidimensional array <pre><code> Checkbox[,] checkArray = new Checkbox[2, 3]{{checkbox24,checkboxPref1,null}, {checkbox23,checkboxPref2,null}}; </code></pre> <p>I am getting error . How do I initialize it? </p>
<p>OK, I think I see what's happening here. You're trying to initialize an array at a class level using this syntax, and one of the checkboxes is also a class level variable? Am I correct? </p> <p>You can't do that. You can only use static variables at that point. You need to move the init code into the constructor. ...
Equivalent of java's ConcurrentHashMap in C#? <p>is there anything?</p>
<p>There is a generic Dictionary class for implementing associative arrays (aka hashtables). Recently MS came out with the ConcurrentDictionary class: <a href="http://msdn.microsoft.com/en-us/library/dd287191.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/dd287191.aspx</a> which is probably what you want....
How to convert a string to RegularTimePeriod in java? <p>I am using Jfreechart. I have the code like this:</p> <pre><code>TimeSeries t1 = new TimeSeries("EUR/GBP"); t1.add(new Day(4, MonthConstants.JANUARY, 2001), new Double(1.5807)); </code></pre> <p>But I get <code>String</code> from my SQL query. TimeSeries accept...
<p>First you can get a Date object by parsing your mysql date string using a SimpleDateFormat, then create your RegularTimePeriod using the constructor with a Date arg.</p> <p>Basically (assuming mysqlDateStr is your string from mysql query) :</p> <pre><code>SimpleDateFormat standardDateFormat = new SimpleDateFormat(...
Why does IE7 when clearing a float result in a margin bug? <p>I have a very simple HTML page (validates as XHTML 1.0 Strict):</p> <pre><code>&lt;div class="news-result"&gt; &lt;h2&gt;&lt;a href="#"&gt;Title&lt;/a&gt;&lt;/h2&gt;&lt;span class="date"&gt;(1-1-2009)&lt;/span&gt; &lt;p&gt;Some text...&lt;/p&gt; &lt...
<p>Can I assume that you have a doc-type?</p> <p>However, change the h2 and span to display: inline; should also clear up your issue. </p> <p>Edit --- adding hasLayout</p> <p>Understanding that inline isn't always an option, here's an <a href="http://www.search-this.com/2007/09/05/lets-be-clear-about-this/" rel="nof...
python setup.py develop not updating easy_install.pth <p>According to <a href="http://peak.telecommunity.com/DevCenter/setuptools#development-mode" rel="nofollow">setuptools</a> documentation, setup.py develop is supposed to create the egg-link file and update easy_install.pth when installing into site-packages folder....
<p>Reinstall setuptools with the command <code>easy_install --always-unzip --upgrade setuptools</code>. If that fixes it then the zipping was the problem.</p>
Is it possible to run custom actions during uninstall using InstallShield 2009 <p>I need to run a custom action during uninstallation of a ManagedCode which is a part of the installation (Before it is removed in the uninstall process) Is it possible in Install Shield 2009?</p>
<p>Yes you can run a ManagedCode custom action as part of the uninstall. You just need to sequences it in the Install Exec Sequence with a condition of REMOVE="ALL". InstallShield is just a wrapper around Microsoft's MSI technology, so many times it is best to go the MSDN for help understanding what you want to do. ...
How do I find the caller of a method using stacktrace or reflection? <p>I need to find the caller of a method. Is it possible using stacktrace or reflection?</p>
<pre><code>StackTraceElement[] stackTraceElements = Thread.currentThread().getStackTrace() </code></pre> <p>According to the Javadocs:</p> <blockquote> <p>The last element of the array represents the bottom of the stack, which is the least recent method invocation in the sequence. </p> </blockquote> <p>A <code>Sta...
Access Non-Public members of a GridViewCommandEventArgs object <p>I have a gridview on my aspx page set up the OnRowCommand event using a series of ASP.NET LinkButton object to handle the logic using the CommandName property. I need to access the GridViewRow.RowIndex to retrieve values from the selected row and notice...
<p>Not the cleanest thing in the world but this is how I've done it in the past. Usually I'll make it all one line but I'll break it down here so it's more clear.</p> <pre><code>LinkButton lb = (LinkButton) ((GridViewCommandEventArgs)e.CommandSource); GridViewRow gr = (GridViewRow) lb.Parent.Parent; var id = gr.RowI...
What are some best practices to support multiple resolutions in a web application? <p>What are some best practices on enabling a web application to support multiple resolutions? Specifically resolutions that are wide-screen vs. normal aspect ratio.</p> <p>It doesn't seem like there is an easy answer - other than simp...
<p>You can always try to use a <em>liquid layout</em> structure where the width of your elements are scaled proportionate to how wide their browser window is.</p> <p>here is a good article explaining different layouts including liquid layout.</p> <p><a href="http://www.maxdesign.com.au/presentation/liquid/" rel="nofo...
Is endian conversion required for wchar_t data? <p>In C/C++, if a multi-byte wide character (wchar_t) value is transmitted from a big-endian system to a little-endian system (or vice-versa), will it come out the same value on the other side? Or will the bytes need to be swapped?</p>
<p>Yes you will need to swap them.<br> The bytes will be retrieved from the transport in the same order they were put in. Just at the other end the ordering of these bytes has a different meaning. So you need to convert them to the correct endian-ness (is that a word?).</p> <p>The tried and true method is to convert t...
Is a glossy or matte LCD screen better for long coding sessions? <p>I'm looking at getting a new LCD monitor, but I'm concerned that a glossy monitor might cause more eye strain after a long day of work. I typically spend a lot of time in front of my monitor, so eye strain is definitely something I have thought about. ...
<p>Matte, because you get less reflections on it, which is good if your workplace is bright. I've worked with both, but especially if you have bright objects around your monitor, or windows at the side, you'll really want to have a matte one.</p> <p>Constantly having reflections in it is really annoying, and hurts the...
How do you put a gradient background on ASP.NET menu items? <p>The boss wants the master page's menu to look nicer. I generated my gradient file with one of the tools available on the net, no problem there..</p> <p>I tried to make a CSS class for each menu item but when I use the background-image directive and the st...
<p>The url in your CSS needs to be an absolute (or relative) url and not use the tilde mapping as it is not a server-side component.</p> <pre><code> background-image: url( "/images/menu.jpg" ); </code></pre>
3ds max object to opengl <p>I am trying to assemble a scene in opengl, using already made objects. The problem is that the object are in .max format and have no external textures. How could I import my objects in opengl, without retexturing them. I am thinking about exporting them to 3ds and using a 3ds file loader. Co...
<p>You might want to check out <a href="http://www.lib3ds.org/">lib3ds</a> which will parse the 3ds binary format for you and give you access to all of the objects properties. I think Autodesk also has their own toolkit for doing this.</p>
How to copy a few chars from a char[] to a char* in C? <p>Yo!</p> <p>I'm trying to copy a few chars from a char[] to a char*. I just want the chars from index 6 to (message length - 9).</p> <p>Maybe the code example will explain my problem more:</p> <pre><code>char buffer[512] = "GET /testfile.htm HTTP/1.0"; char* f...
<p>I assume you meant...</p> <pre><code>strncpy(filename, buffer+5, msgLen-9); </code></pre> <p>The problem is you haven't allocated any memory to hold the characters you're copying. "filename" is a pointer, but it doesn't point at anything.</p> <p>Either just declare</p> <pre><code>char filename[512]; </code></pre...
XML Deserialization - convert attribute value into class automatically (.net) <p>(vb.net/c#/etc)</p> <p>I am having trouble figuring out how to do a bit of deserialization magic. Currently the standard deserialization works fine, including the enums, but <em>now</em> I want to convert an attribute into a class. Oh! ...
<p>This is not supported in a declarative way. You will have to implement IXmlSerializable on the parent class (the one that is serialized to an element) and perform the conversion between the string and the MyValue type manually.</p>