input stringlengths 51 42.3k | output stringlengths 18 55k |
|---|---|
Moving Mac's user settings to another users <p>I have three new admin users for my Mac: Math, CS and Fun.</p>
<p>I would like to move my user settings such as keyboard layout and other config files in the user Masi to other users.</p>
<p>I use mostly terminal softwares.</p>
<p><strong>How can you move the user setti... | <p>Most programs store preferences in subfolders of ~/Library. Just copy corresponding folders, but be careful, you can break something.</p>
|
Regexp for matching numbers and units in an HTML fragment? <p>I'm trying to make a regexp that will match numbers, excluding numbers that are part of other words or numbers inside certain html tags. The part for matching numbers works well but I can't figure out how to find the numbers inside the html.</p>
<p>Current ... | <pre><code><script>
var htmlFragment = "<script>alert('hi')</script>";
var style = "<style>.foo { font-size: 14pt }</style>";
// ...
</script>
<!-- turn off this style for now
<style> ... </style>
-->
</code></pre>
<p>Good luck getting a regular express... |
imagecreatefromjpeg is silently terminating scripts <p>Like so many before me, I'm writing a PHP script to do some image thumbnailing. The script has earned WOMM (works on my machine) certification, but when I move it to my host (1&1 Basic), there's an issue: images above a certain filesize cannot be processed. I'v... | <p>Please see <a href="http://pt.php.net/manual/en/function.imagecreatefromjpeg.php#76968" rel="nofollow">this note</a> regarding memory usage on the php website.</p>
<p>*"The memory required to load an image using imagecreatefromjpeg() is a function of the image's dimensions and the images's bit depth, multipled by a... |
how do you set a max-age for javascript/css? <p>I just ran <a href="http://webpagetest.org/" rel="nofollow">Pagetest</a> and it says I need to set a max-age for my JS/CSS. How do I do that?</p>
| <p>Sounds like it's talking about HTTP headers. Basically you'll need to add a couple of HTTP headers to be sent with your Javascript and CSS files (and images too, would be a good idea), looking something like this:</p>
<pre><code>Cache-Control: max-age=86400
Expires: Sat, 28 Mar 2009 16:00:00 GMT
</code></pre>
<p>T... |
How to create an aggregate Atom feed from two Atom feeds using LINQ to XML <p>Just took a stab at creating an aggregate feed - from two separate Atom feeds - sorted descending by published date... </p>
<p>UPDATE: Thanks to Martin Honnen (MVP) over at <a href="http://social.msdn.microsoft.com/Forums/en-US/categories/" ... | <p>I would look into the <a href="http://msdn.microsoft.com/en-us/library/system.servicemodel.syndication.syndicationfeed.aspx" rel="nofollow">SyndicationFeed</a> Class. Here is a sample of generating a feed using this.</p>
<pre><code>private static SyndicationFeed CreateFeed(List<SyndicationItem> items)
{
... |
Does x86 have an atomic increment that keeps the value that was stored? <p>I have found <code>lock inc addr</code> but that doesn't keep a copy of the stored value around and even a read immediately after it in the same thread could come after a competing write.</p>
<p>The best solution I have found is a <code>load</c... | <p><code>lock xadd</code> is your friend.</p>
|
code page values <p>apart from 1252 what other code page values can be used with getencoding() in vb.net?</p>
<p>System.Text.Encoding.GetEncoding(1252).Getstring()</p>
| <p>Well, any code page that's supported by your system. 437 is one of the old DOS code pages, for example, and 28591 is ISO-Latin-1.</p>
<p>Here's a <a href="http://msdn.microsoft.com/en-gb/goglobal/bb964653.aspx">list of lists of code pages</a> from Microsoft, but you should use Encoding.GetEncodings to see what's av... |
Is MSXML4 thread safe? <p>I would like to know if I create an instance of Msxml2.FreeThreadedDOMDocument.4.0 in one thread, can I safely manipulate the instance from different threads using raw pointers?</p>
| <p>Yes. That is the point of the FreeThreadedDOMDocument. </p>
<p>cite: <a href="http://msdn.microsoft.com/en-us/library/ms756987%28VS.85%29.aspx" rel="nofollow">IXMLDOMDocument/DOMDocument</a></p>
<blockquote>
<p>If you are writing a single threaded
application (or a multi-threaded
application where only one ... |
Passing variables and data through a regular web page link? <p>I'm working with a page where I'm trying to submit data when a link is clicked. I already know how to do this with POST and GET using javascript buttons, but how do I get the same effect when I'm working with HTML links?</p>
| <p>If you have a plain link you can pass them as query parameters on the link (which is a GET operation)</p>
<pre><code><a href="/myapp/somecontroller.php?id=17&name=fred">Save</a>
</code></pre>
<p>If you have a plain HTML form with no javascript to handle the button press you can put things in hidden... |
Add or extend file system support under windows <p>I've seen that <a href="http://www.mediafour.com/products/macdrive/" rel="nofollow">Mac Drive 7</a> adds HFS+ and HFS support to windows for both hard-drives and CDs, which includes handling problems like the mac partition format. Clearly that must mean that file syste... | <p>You need the <a href="http://www.microsoft.com/whdc/devtools/wdk/default.mspx">Windows Driver Kit</a> (WDK). The <a href="http://www.microsoft.com/whdc/devtools/ifskit/default.mspx">Installable File System Kit</a> which is part of the WDK should get you started.</p>
<p>Good luck!</p>
|
Giving candidates interview questions in advance of the interview <p>I'm going to be interviewing for a small team of creative/developers in the next few months. I'm thinking of getting each candidate to put together a short pitch, based on our ideas so I know they get what we're trying to acheive. Of course we'll comm... | <p>What you need is not someone who understand your market/products/big picture, you need someone <em>capable of understanding it</em></p>
|
Recommended data structure/format for web MVC applications? <p>What's a good data structure for use in MVC web applications to use to pass data into view to ensure standardization and keep the view as non-coder friendly as possible?</p>
| <p>Use a custom model class and keep it as non-coder friendly as possible :)<br />
How you construct the model class strongly depends on the specific page.</p>
|
To get notification after download? <p>imageData = [[NSData alloc] initWithContentsOfURL:[NSURL URLWithString:srcAddres]];</p>
<p>Downloading jpeg to my imagedata will spend some time,for example:2 second,so I want to show an activity indicator until the downloading finished . How can I know when the downloading has f... | <p>You'll need to use the asynchronous URL loading system instead (<code>NSURLConnection</code> on the iPhone SDK). Here's Apple's documentation:</p>
<p><a href="http://developer.apple.com/DOCUMENTATION/Cocoa/Conceptual/URLLoadingSystem/URLLoadingSystem.html" rel="nofollow">http://developer.apple.com/DOCUMENTATION/Coc... |
Binding Visible property of a DataGridColumn in WPF DataGrid <p>I cannot bind the Visible property of the WPF datagridtextcolumn to a boolean value.</p>
<p>My binding expression is,</p>
<pre><code>{Binding Path=DataContext.IsThisColumnVisible, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window},Con... | <p>I worked this out.</p>
<p>DataGridCOlumn is not a framework element so the FindAncestor call was failing (DataGridColumn not part of visual tree)</p>
<p>Have to set source property of binding expression to a staticresource and it works fine.</p>
|
Daily risk estimation for your team <p>Assume that you leads team of 4 developers. How often would you estimate the risk of the project? What do you think about the daily estimation? Do you think that the daily updates of the potencial problems (based on the morning stand-up meetings with the team) released as a short ... | <p>The daily stand up -- done right -- is a great way to reduce risk on your project because it increases the amount of communication between team members and helps you discover problems earlier. However, the stand-up can't take too long or it will itself become a threat -- people will avoid bringing up potential issu... |
Convert Yahoo Messenger Logs to Adium Logs <p>Is there a way to convert logs from YM for mac to Adium ?</p>
<p>Thanks
Cezar</p>
| <pre><code>#!/usr/bin/perl
use warnings;
use strict;
use File::Find;
use File::Copy;
use Getopt::Long;
my $inDir = undef;
my $outDir = undef ;
my $adiumUser = undef;
my $force = 0;
my $foundLogs = 0;
my $help = 0;
my %Protocols = ( #Map gaim protocol IDs to Adium ones
"ai... |
Disabling msgbox in access <p>I am trying to make a small form in MS Access 2003 SP3, I use some function that some other people made and these function has msgbox in it. I would like to disable msgbox while I am running the form. Is it possible in Access to disable msgbox?</p>
| <p>I created my finction called msgbox. Seems like its working. Thanks everyone for your help.</p>
<pre><code>Public Function MsgBox(Prompt, Optional Buttons As VbMsgBoxStyle = vbOKOnly, Optional Title, Optional HelpFile, Optional Context) As VbMsgBoxResult
If myProcedureisRunning then
VBA.MsgBox Prompt
else
... |
Split old .NET code into designer partial class <p>I'm working on an older .NET code base that has all the designer code stuffed into the same code file as my code (pre - partial classes).</p>
<p>Is there a mechanism to tell Visual Studio 2008 to go back and refactor designer code into a X.designer.cs partial class fi... | <p>What I just did was completely manually:</p>
<ol>
<li>Create <em>yourform</em>.Designer.cs</li>
<li>Add it to Visual Studio (right click, add existing item)</li>
<li>Add the <em>partial</em> keyword to your existing class.</li>
<li>Add the <em>namespace</em> <strong>exactly like in the original cs</strong> to the <... |
WPF: XAML Custom Namespace <p>Okay so I have a Window in WPF. I add the following line inside of it:</p>
<pre><code>xmlns:controls="clr-namespace:mCubed.Controls"
</code></pre>
<p>This compiles and runs just fine, but the Visual Studio designer gives me this error:</p>
<blockquote>
<p>Could not load file or assemb... | <p>Not an assembly problem, just a designer problem. The VS WPF designer in 2008 is primitive at best - completely useless IMHO. I turn it off completely and use the XML editor instead. Hopefully things will improve drastically in 2010.</p>
|
.NET setup projects using Visual Studio 2008 <p>When you create a Setup project for a Windows/Console application, you find that there are two outputs.</p>
<ol>
<li>Setup.exe</li>
<li>.msi</li>
</ol>
<p>What does setup.exe and <em>.MSI</em> do? Which one should be used for installation?</p>
<p>I have seen that I can... | <p>The MSI is the installer for you application. The setup file is a bootstrap that will check for pre-reqs. Like correct version of the windows installer. I think it is also the setup.exe that will allow download of the right version of the .NET framework.
You can use the .MSI on its own, you can't use just the set... |
Encoding of string returned by GetUserName() <p>How do I get the encoding that is used for the string returned by <code>GetUserName</code> from the win32 API? I'm using pywin32 and it returns an 8-bit string. On my German XP, this string is obviously encoded using Latin-1, but this might not be the case for other Windo... | <p>You can call <a href="http://msdn.microsoft.com/en-us/library/dd318070%28VS.85%29.aspx">GetACP</a> to find the current ANSI codepage, which is what non-Unicode APIs use. You can also use <a href="http://msdn.microsoft.com/en-us/library/bb202786.aspx">MultiByteToWideChar</a>, and pass zero as the codepage (CP_ACP is ... |
Custom scrollbars <p>I'm working on making an application with adobe air and I have a div that uses overflow-y. In order for the UI to look nice and sexy, what's the best way to replace the ugly <a href="http://grabup.nakedsteve.com/a0fd084a9117dc8b1fe6626eda535d98.png" rel="nofollow">default scrollbar</a> [link broken... | <p>Don't.</p>
<p>Users know how to to use the default platform UI widgets: they know what they look like, how they behave, etc. And the platform ones work really well.</p>
<p>They won't know how to use your widget. And even if you try and copy the platform one except for appearance, your widget will behave as a cheap... |
xPath Traversing <p>I am trying to use xPath to traverse through the code of a newspaper (for the sake of practice) right now I'd like to get the main article, it's picture and the small description I get of it. But I'm not that skilled in xPath so far and I can't get to the small description.</p>
<p>withing this code... | <p>You say "id" of resumenesto, but in your code example the div you're talking about has a class of resumenesto.</p>
<p>Further, when you use an xpath of something like this:</p>
<pre><code>//div[@class='resumenesto']
</code></pre>
<p>What you're getting is a list of nodes matching that xpath.
So if you want to spe... |
Fluent Nhibernate and pluggable inheritance <p>Is there any way to define/expand inheritance without changing base table mapping with Fluent NHibernate? For example with Castle.ActiveRecord (based on NHibernate) you can define inheritance like this:</p>
<pre><code>[ActiveRecord("entity"), JoinedBase]
public class Enti... | <p>Not right now, no. Certainly not in any way that will require <em>no</em> modifications to your parent class map.</p>
|
Programmatically printing directory of word documents... last file always skipped <p>I am having a problem when trying to programmatically print a directory of word documents. In this example, I am trying to print only the files with the "3_" prefix. The problem is that the file does not print unless there are two fi... | <p>Try and set the Background parameter (1st param) of the <a href="http://msdn.microsoft.com/en-us/library/bb237242.aspx" rel="nofollow">PrintOut</a>() call to False.</p>
<p>Probably the last print job is not completely spooled and canceled since the Word COM object is released too early.</p>
|
Displaying PDFs in Silverlight <p>I want to make a PDF document reader, and the only thing I've found to help me is "Amyuni PDF Suite" that will turn the PDF into XAML and stream that. Are there any other controls for displaying PDFs in Silverlight? Or could I add an IFrame into Silverlight and let the client render it... | <blockquote>
<p>Or could I add an IFrame into Silverlight and let the client render it?</p>
</blockquote>
<p>Silverlight doesn't really have that capability. You can make your Silverlight control transparent, and have an HTML div block that sits above your Silverlight control, which you could then load a PDF in, but... |
ConvertEmptyStringToNull property <p>A)
public void GetEmployee( int EmployeeID );</p>
<pre><code><asp:ObjectDataSource SelectMethod=âGetEmployeeâ â¦>
<SelectParameters>
<asp:ControlParameter Name = âEmployeeIDâ ...>
</SelectParameters>
</code></pre>
<p><br /></p>
<p>If for... | <p>A) It appears that the ODS is generating the default value for null of type T. In the case of an int, the default value is a 0.</p>
<p>B) There is no way in HTML to represent a null value via an input tag. When an emptry string is passed to an ODS and Convert Empty to Null is set to true, a null value will be set. ... |
Displaying a URL in a UITableViewCell in a different color from the rest of the text <p>I'm working through the Stanford iPhone programming course online. The Presence app assignment pulls Twitter and displays each one in a separate UITableViewCell.</p>
<p>Updates often include URL's and I'd like to know how to displ... | <p>As said above a button would work, but in terms of the UI it would probably look more natural if you had a label.</p>
<p>Alternatively, you could fill the UITableViewCell with a UIWebView. The UIWebView would hold all the text and you should easily be able to set part of the text as a link (color blue) using html.... |
Ampersand (&) operator in a SQL Server WHERE Clause <p>Sorry for the very basic question. What does the <code>&</code> operator do in this SQL</p>
<pre><code>WHERE (sc.Attributes & 1) = 0
</code></pre>
<p><code>sc</code> is an alias for a table which contains a column <code>attributes</code>.</p>
<p>I'm try... | <p><a href="http://msdn.microsoft.com/en-us/library/ms174965.aspx">& is the bitwise logical and operator</a> - It performs the operation on 2 integer values. </p>
<pre><code>WHERE (sc.Attributes & 1) = 0
</code></pre>
<p>The above code checks to see if sc.Attributes is an even number. Which is the same as ... |
How do can you make redirect_to use a different HTTP request? <p>At the end of one of my controller actions I need to redirect to a page that only accepts put requests. I have been trying to figure out how to get redirect_to to use a put request but to no success. </p>
<p>Is this possible? Or is there another way to a... | <p>I don't think you are able to do this, and I suspect that the limitation is part of HTTP itself.</p>
<p>When using <strong>redirect_to</strong> - the redirection happens as a "302 Moved" header unless otherwise specified in the parameters.</p>
<p>Having a look at the HTTP Spec itself doesn't reveal any way to cha... |
jQuery getTime function <p>is it possible to create a jQuery function so that it gets current date and time? I've been looking around documentation but haven't found anything so far...</p>
| <p>@nickf's correct. However, to be a little more precise:</p>
<pre><code>// if you try to print it, it will return something like:
// Sat Mar 21 2009 20:13:07 GMT-0400 (Eastern Daylight Time)
// This time comes from the user's machine.
var myDate = new Date();
</code></pre>
<p>So if you want to display it as mm/dd/y... |
Crash when calling stringByEvaluatingJavaScriptFromString on UIWebView from button <p>I can't find any documentation to confirm this, but it appears that you can only call the method <strong>stringByEvaluatingJavaScriptFromString</strong> in overridden methods from a UIWebView delegate. Can anyone confirm this?</p>
<p... | <p>I still don't know the exact reason this didn't work, but I found I could rewrite my code to get called during the UIWebView delegate methods instead.</p>
|
Default form submit behavior after jQuery forms.js ajaxSubmit executes <p>I'm using the jQuery Form Plugin to bind the submit events for two forms on the same page so that they are submitted to separate PHP scripts that return markup to separate divs on the page.</p>
<p>One form refreshes the next. I use "live" so eac... | <p>Not sure if it's related to your problem, but <a href="http://docs.jquery.com/Events/live" rel="nofollow"><code>live()</code> does not support the "<code>submit</code>" event</a>:</p>
<blockquote>
<p>Currently not supported: <code>blur, focus,
mouseenter, mouseleave, change, submit</code></p>
</blockquote>
|
How to publish an application in Visual Studio? <p>I'm working on a small console application in Visual Studio C++ 2008 and would like to make an installer that I can distribute to a few friends to test the application. I recall a publish option being under the build menu, but it is not there now. Could I somehow hav... | <p><a href="http://msdn.microsoft.com/en-us/library/ms235317.aspx" rel="nofollow">Deploying Your Program (C++)</a></p>
|
Managing Unregistered User Posts by Screening <p>I am considering allowing users to post to my site without having them register or provide any identifying information. If each post is sent to a db queue and I then manually screen these posts, what sort of issues might I run into? How might I handle those issues?</p>
| <p>Screening every post would be tedious and tiresome. And prone to annoying admin spam. My suggestion would be to automate as much of screening as possible. And besides, providing any identifying information does nothing to prevent spam (a bot will just generate it).</p>
<p>A lot of projects implement recognition sys... |
Application to reverse engineer MySQL & PostgreSQL DB? <p>Is there an application to reverse engineer an existing database in mysql and/or postgre? </p>
<p>I'm interested in obtaining the DB diagram from an existing one, similar as it can be done in MSSQL Server</p>
| <p>For MySQL, try <a href="http://dev.mysql.com/workbench/" rel="nofollow">MySQL Workbench</a>.</p>
<p>For both MySQL and PostgreSQL, try <a href="http://www.casestudio.com/enu/reverse.aspx" rel="nofollow">TOAD Data Modeler</a>.</p>
<p>If you use the open-source diagram app <a href="http://live.gnome.org/Dia" rel="no... |
Move all files except one <p>How can I move all files except one? I am looking for something like: </p>
<pre><code>'mv ~/Linux/Old/!Tux.png ~/Linux/New/'
</code></pre>
<p>where I move old stuff to new stuff -folder except <code>Tux.png</code>. !-sign represents a negation. Is there some tool for the job?</p>
| <p>If you use bash and have the <code>extglob</code> shell option set (which is usually the case):</p>
<pre><code>mv ~/Linux/Old/!(Tux.png) ~/Linux/New/
</code></pre>
|
Threading in .net <p>I have a simple example of a winforms application where i choose a directory in a directory chooser and click a button to loop through the directory and copy each file in the directory into another directory.</p>
<p>i want to do the file copy on a background thread to avoid locking the GUI.</p>
... | <p>I would recommend using the <a href="http://msdn.microsoft.com/en-us/library/system.componentmodel.backgroundworker%28VS.80%29.aspx" rel="nofollow">BackgroundWorker</a> class.</p>
<p><a href="http://msdn.microsoft.com/en-us/library/system.componentmodel.backgroundworker.dowork.aspx" rel="nofollow">Example</a>.</p>
|
Mac 10.4 Sync Files <p>I am using Google code svn and have a repository setup. Inside the repository I am including TinyMCE and now I want to upgrade all the files in this folder. The problem I am having is if I checkout locally and then download their new version and replace the folder it wipes out all my svn files. ... | <p>What you may want is to setup <a href="http://svnbook.red-bean.com/en/1.0/ch07s03.html" rel="nofollow">svn:externals</a>, or you may also want to take a look at something like <a href="http://piston.rubyforge.org/index.html" rel="nofollow">Piston</a>.</p>
|
Class in the BCL that will event at a given DateTime? <p>Is there an object that will event at a given DateTime or DateTimeOffset? I am using a Timer to do this operation now but it requires a bit of calculation on my part, was just thinking there might already be something in place.</p>
| <p>I don't see how you have to do any calculation:</p>
<pre><code>public void StartTimer(DateTime target) {
double msec = (target - DateTime.Now).TotalMilliseconds;
if (msec <= 0 || msec > int.MaxValue) throw new ArgumentOutOfRangeException();
timer1.Interval = (int)msec;
timer1.Enabled = true;
}
</code>... |
What is IDL? <p>What is meant by IDL? I have googled it, and found out it stands for Interface Definition Language, which is used for interface definition for components. But, in practice, what is the purpose of IDL? Does Microsoft use it?</p>
| <p>An interface definition language (IDL) is used to set up communications between clients and servers in remote procedure calls (RPC). There have been many variations of this such as Sun RPC, ONC RPC, DCE RPC and so on.</p>
<p>Basically, you use an IDL to specify the interface between client and server so that the RP... |
Is there a standard place to put the version number in the source code? <p>I want to have one file where I can check which version is installed. Its a PHP program so you can look into the files. I was thinking if there is a standardized place to put it since in the Zend Framework or the HTMLpurifier I can't find the ve... | <p>I found it..</p>
<p>in the Zend Framework they have a file called Zend/Version.php -> Zend_Version this file also has the Version number inside of it:</p>
<pre><code>const VERSION = '1.7.5';
</code></pre>
<p>In the HTMLPurifier it's located in HTMLPurifier/HTMLPurifier.php</p>
<pre><code>/** Version of HTML Puri... |
Root servers for web development - how much power is enough? <p>I think this question has not to do with programming in general, but nevertheless the answers might be interesting to other web developers.</p>
<p>I just wondered how to estimate the minimum requirements to have a fast website. Obviously there are some fa... | <p>This is arguably more art than science.</p>
<p>What you have to remember is that like many things in programming and IT, your website will be as slow as the slowest link in the chain, meaning you will have some bottleneck such as bandwidth, the Web servers, disk I/O, memory, your databases, your firewall, etc that ... |
Cascading style sheets use "id" or "class" <p>when styling specific html elements, i tend to always use the class attribute. the css code looks cleaner imo.</p>
<p>why do both exist which one should you use and when ?</p>
| <p><strong>id</strong>s <strong>id</strong>entify elements. <strong>class</strong>es <strong>class</strong>ify elements.</p>
<p>Put a class on an element if "it's a kind of ..." (e.g. address)</p>
<p>Put an ID on an element if "it is <em>the</em> ..." (e.g. navigation)</p>
|
Read Data from 2 Lists into the Third List in MOSS 2007 <p>I got 2 lists displaying invoice details, now my boss wants to read specific field from these two lists into a third list, any help will from anybody out there? I'm new to SharePoint.</p>
| <p>Are the two lists too big? if so you should take a look at the WSS upgrade API. It contains methods to do bulk copies; afterwards, the easiest way to transfer individual items is making an event receiver that listens to the itemAdded event.</p>
|
How do I get shoes executable into my path? <p>I'm getting started with shoes and the nks docs tell me two write a script and then launch it like this:</p>
<pre><code>> shoes myapp.rb
</code></pre>
<p>the shoes executable is in the Shoes.app I installed. Thus, shoes is not in my path so I can't do this.</p>
<p>Tr... | <p>You need to give an absolute path when making the symlink</p>
<p>and you need to give the path inside the app bundle, such as <code>Shoes.app/Contents/MacOS/Shoes</code> maybe</p>
<p>Edit:</p>
<p>you could always add the following line to your .profile (assuming bash)</p>
<pre><code>export PATH=$PATH:/Applicatio... |
Trying to override formatting implementation of static method in compiled SDK <p>I am working with the Community Server framework.</p>
<p>One of the provided form controls allows the user to update his/her 'status'. For example: 'Joe: is going to get coffee : 12:30am'.</p>
<p>I want to change the format of that mess... | <p>The short answer is you can't override a static method.</p>
<p>The long answer and some workarounds are in <a href="http://blogs.msdn.com/kirillosenkov/archive/2008/02/06/how-to-override-static-methods.aspx" rel="nofollow">this article</a> </p>
|
Performance of inner join compared to cross join <p>The effect of issuing an inner join is the same as stating a cross join with the join condition in the WHERE-clause. I noticed that many people in my company use cross joins, where I would use inner joins. I didn't notice any significant performance gain after changin... | <p>Cross Joins produce results that consist of every combination of rows from two or more tables. That means if table A has 6 rows and table B has 3 rows, a cross join will result in 18 rows. There is no relationship established between the two tables â you literally just produce every possible combination.</p>
<p... |
How to get the lists of file and directory names of a site? <p>How exactly do you do this? The reason is my CMS has been breached, well, mainly because the username and password is fairly common (my bad). But I've always thought that it is save, since the directory name is pretty un-common and hard to guess (not the us... | <p>Did you ever surf somewhere via a link from your CMS? Your browser would have sent a referer (note the misspelling) header, indicating where you came from.</p>
|
Reference Access database dataset.designer file in WPF? <p>Hey, I've included an MS Access database in my WPF VB app, and I'm trying to link the data to an XCEED Datagrid. I have the following code in my testerDataSet.Designer.vb file which I assume is the funcion I should be referencing</p>
<pre><code>Public ReadOnly... | <p>Can you update your sample to include the code for the static resource testerDataSet? </p>
<p>One way you can try and work around this problem is to set the Binding directly in imperative code. </p>
<pre><code>DataGridControl1.DataContext = testerDataSet.Contact
</code></pre>
<p>Then you could modify your WPF c... |
.NET Sample Project Design Patterns Fowler <p>Are there sample ASP.NET projects around using the patterns discussed in the book by Martin Fowler (<a href="http://rads.stackoverflow.com/amzn/click/0321127420" rel="nofollow">Patterns of Enterprise Application Architecture</a>)?</p>
<p>I have downloaded the Northwind sta... | <p><a href="http://www.dofactory.com/Patterns/Patterns.aspx" rel="nofollow">dofactory.com</a> as C# and VB.NET GoF pattern examples. They also have a full ASP.NET web application example detailing the use of the patterns, although I don't think that is a free download.</p>
|
Is there a CalDAV client library for Java? <p>I want to communicate using CalDAV protocol with my calendar server. Are there any supported Java client libraries for this?</p>
| <p>Try <a href="http://code.google.com/p/caldav4j/">CalDAV4j</a></p>
|
Using Eclipse Templates for Actionscript <p>One of my favorite features in Eclipse is the templates in PDT. In case you don't know what they are, think of writing "function" and having Eclipse write all the syntactical features and let you jump from variable to variable with a tap of the tab key. So I'm starting to do ... | <p>What Eclipse Plugin are you using for Actionscript ?</p>
<p>I'm using FDT which includes templates (Prefereces>FDT>Editor>Templates).</p>
<p>EDIT:</p>
<p>It's not directly included in FLEX Builder. Here's a workaround (not tested) :</p>
<p><a href="http://www.adobe.com/cfusion/communityengine/index.cfm?event=sho... |
Tips for managing a large number of files? <p>There are some very good questions here on SO about file management and storing within a large project.</p>
<blockquote>
<p><a href="http://stackoverflow.com/questions/3748/storing-images-in-db-yea-or-nay">Storing Images in DB - Yea or Nay?</a><br>
<a href="http://stac... | <p>One way is to assign a unique number to each file and use it to look up the actual file location. Then you an use that number to distribute files in different directories in the filesystem. For example you could use something like this scheme:</p>
<p><code>/images/{0}/{1}/{2}</code></p>
<blockquote>
<p><code>{0}... |
QSortFilterProxyModel.mapToSource crashes. No info why <p>I have the following code:</p>
<pre><code>proxy_index = self.log_list.filter_proxy_model.createIndex(index, COL_REV)
model_index = self.log_list.filter_proxy_model.mapToSource(proxy_index)
revno = self.log_list.model.data(model_index,QtCore.Qt.DisplayRole)
self... | <p>It may be that you're using the proxy model's createIndex() method incorrectly. Usually, the createIndex() method is called as part of a model's index() method implementation.</p>
<p>Have you tried calling the proxy model's index() method to get a proxy index then mapping that to the source?</p>
<p>Perhaps you cou... |
How do I add a space between two concatenated NSStrings? <p>I have three string objects:</p>
<pre><code>NSString *firstName;
NSString *lastName;
NSString *fullName;
</code></pre>
<p>The values for <code>firstName</code> and <code>lastName</code> are received from NSTextFields.</p>
<p>I then want to concatenate the t... | <p>I'm amazed by the length of the other answers:</p>
<pre><code>fullname = [NSString stringWithFormat:@"%@ %@", firstname, lastname];
</code></pre>
|
Static extension methods on Seq module <p>According to <a href="http://codebetter.com/blogs/matthew.podwysocki/archive/2008/09/10/object-oriented-f-extension-everything.aspx">this post</a>, F# supports extension methods on object instances and static classes. For example:</p>
<pre><code>module CollectionExtensions =
... | <p>To extend an F# <em>module</em>, just create another module with the same name:</p>
<pre><code>module Seq =
let myMap f s = seq { for x in s do yield f x }
Seq. // see your stuff here alongside normal stuff
</code></pre>
|
how to find a loop in the file system? <p>how to find a loop in the file system in Linux? i am indexing all files for making search fast(O(1))... i am using c programming language to implement by using the library functions in dir.h.... I can scan through entire file system but it goes in a loop if there is loop in the... | <p>The general way to prevent re-scanning nodes in a graph is to mark nodes as you pass them, and then ignore nodes that are marked. This isn't terribly practical if you don't want to modify the graph you are scanning over, so you need a way to mark the nodes externally. The easiest way I can think of to do this unde... |
Am I understanding the sequence of events in this Ruby grep example? <p>I'm trying to understand how grep works in this example. The code works but I'm not 100% sure in what sequence the events take place or whether I'm correctly understanding what's being returned when and where.</p>
<pre><code>cars = [:Ford, :Toyota... | <p>First of all, <a href="http://www.ruby-doc.org/core/classes/Enumerable.html#M003152" rel="nofollow">here's the documentation for grep</a></p>
<p>Let me clean up your code and explain it piece by piece</p>
<pre><code># 1
cars = [:Ford, :Toyota, :Audi, :Honda]
# 2
ucased_cars = cars.collect do |c|
c.to_s
end.gre... |
Unable to unzip web2py_win.zip. WINZIP says it is an invalid zip format <p>WINZIP 12.0 and also WINRAR are both unable to open web2py_win.zip version 1.59
They both say the zip format is invalid.</p>
<p>Please advise what to do.</p>
<p>Thanks.</p>
| <p><a href="http://www.7-zip.org/" rel="nofollow">get 7-Zip</a> it can handle anything. Tho I just downloaded web2py_win.zip from <a href="http://www.web2py.com/examples/default/download" rel="nofollow">here</a> and had no problem opening it as a compressed folder using plain ol XP. I think you should re-attempt your d... |
Haskell: How to pipe the contents of one handle into another in real time <p>I am writing a program that runs an external sub process interactively and I need the contents of the output handle to be output to stdout as soon as it is available. I have tried something like this:</p>
<pre><code>main = do processInfo <... | <p><code>hSetBuffering</code> is what you're looking for, the default (on Unix at least) is line buffering. Use it on the stdin before starting the main loop</p>
<pre><code>hSetBuffering hIn NoBuffering
</code></pre>
<p>and optionally also on the output handle if you want to see the results immediately on the output... |
list background colour screwed up in IE7 <p>I've styled some unordered HTML lists and their heading to look like this in Firefox:</p>
<p><img src="http://img24.imageshack.us/img24/711/screenshot001nij.png" alt="alt text" /></p>
<p>Unfortunately, in IE7, they look like this:</p>
<p><img src="http://img11.imageshack.u... | <p>IE and the other browsers have a different default style sheet.</p>
<p>IE indents list items by putting a âmargin-leftâ on the <ul>. The other browsers put a âpadding-leftâ on the <ul>.</p>
<p>So if you want to look the same in all browsers, set both âmargin-leftâ and âpadding-leftâ explicitl... |
Relational Operator Implementation Dilemma <p>I'm in the process of designing several classes that need to support operators <code>!=</code>, <code>></code>, <code><=</code>, and <code>>=</code>. These operators will be implemented in terms of operators <code>==</code> and <code><</code>.</p>
<p>At this st... | <p>Have you considered using <a href="http://www.boost.org/doc/libs/1%5F38%5F0/libs/utility/operators.htm" rel="nofollow">boost</a>, and having your class inherit from <code>boost::less_than_comparable<T></code> and <code>boost::equality_comparable<T></code>? It is akin to your first suggestion, with some p... |
How Does sizeof(Array) work <p>How does c find at run time the size of array? where is the information about array size or bounds of array stored ? </p>
| <p><code>sizeof(array)</code> is implemented entirely by the C compiler. By the time the program gets linked, what looks like a <code>sizeof()</code> call to you has been converted into a constant.</p>
<p>Example: when you compile this C code:</p>
<pre><code>#include <stdlib.h>
#include <stdio.h>
int main... |
REQUIRES_NEW annotated method is executed without a transaction? <p>I have a stateless bean resposible for persisting entities to a database. This stateless bean is called by a message bean's onMessage method. The wired thing is that on the first message everything works fine, but on the next message the method respons... | <p>I tried a lot to solve it and after about 16 hours or so it seems to be working. I'm not sure exactly what did the trick, but it might be the upgrade to Glassfish 2.1. </p>
<p>Finally able to sleep at night again!</p>
|
Hibernate not reflecting changes <p>I have a struts application that uses Hibernate to access a MYSQL DB. I have a number of pages that make changes to the DB. These changes go through fine, data is update in the DB. However when browsing to the page that should show this updated information its often not there, and ev... | <p>Too little information to really give an answer. But some points to check:</p>
<ul>
<li><p>You are using transactions. Are you properly committing them? Maybe at some point your code cannot see changes, because the are not yet commited (or because the reading code is in another transaction which uses previous state... |
Can I detect IE6 with PHP? <p>Is there a way to use PHP to detect if the page is being loaded using IE6?</p>
| <p>Try checking their user agent for <code>'MSIE 6.'</code>.</p>
<pre><code>$using_ie6 = (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 6.') !== FALSE);
</code></pre>
<p>This is based on <a href="http://www.useragentstring.com/pages/Internet%20Explorer/">this user agent information</a>.</p>
|
Building a user interface to an Excel model <p>I built an excel model used to analyze real estate transactions. I would like to create a user interface to overlay the model so that the file can be distributed to clients to evaluate potential investments </p>
<p>The interface will serve two primary functions:
1)Enhanc... | <p>You don't have to use Access, VBA (Visual Basic For Applications) is built right into Excel. There are <a href="http://www.techbookreport.com/tbr0037.html" rel="nofollow">good books available</a> and lots of web resources. Your main problem seems to be the UI is not professional - I'd disagree, out of the box it wil... |
Simple CRUD Generator for C# <p>I am looking for a simple CRUD (or DAL) Generator for C#. I don't want anything heavyweight since I only have a couple of tables in a SQL Server 2008 database.</p>
<p>Any suggestions? I know .netTiers, but it is way too much for what I need.</p>
<p>Thanks!</p>
<p>UPDATE: I tried LINQ ... | <p>I have used SubSonic on past projects, it's lightweight and easy to use.</p>
<p>They offer a simple <a href="http://www.wekeroad.com/webcasts/subsonicintro/intro.html" rel="nofollow">tutorial video</a> and it should take no more than 10 minutes to get it completely setup. I recommend watching the second half of the... |
Comparing String to Integer gives strange results <p>I'm really confused as to why this operation works. Can someone explain it?</p>
<pre><code>$test1 = "d85d1d81b25614a3504a3d5601a9cb2e";
$test2 = "3581169b064f71be1630b321d3ca318f";
if ($test1 == 0)
echo "Test 1 is Equal!?";
if ($test2 == 0)
echo "Test 2 is Equ... | <p><a href="http://il.php.net/manual/en/language.types.string.php#language.types.string.conversion">From the PHP manual</a>:</p>
<blockquote>
<p><strong>String conversion to numbers</strong></p>
<p>When a string is evaluated in a
numeric context, the resulting value
and type are determined as follows.</p>
... |
How do I get a code window to split vertically in Visual Studio 2008? (not HTML mode) <p>In Visual Studio 2008, it seems that <strong>Window -> Split</strong> only gives me a horizontal split, and <strong>Window -> New horizontal tab group</strong> does not allow me to edit the same file in both panes.</p>
<p>Note tha... | <p>Ok, I found the solution <a href="http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=344036">here</a>.</p>
<p>The answer is:</p>
<ol>
<li>Window -> New Window</li>
<li>Window -> New Vertical Tab Group</li>
</ol>
<p>This duplicates the current tab so you'll get <code>[Form1.cs:1]</code... |
smlnj rephrased question for listdir(filename, directoryname) <p>i am a newbie learning sml and the question i am thrown with involves IO functions that i have no idea how it works even after reading it. Here is the 2 questions that i really need help with to get me started, please provide me with codings and some expl... | <p>As a hint I will say that you have to make use of these functions: </p>
<p>OS.FileSys.OpenDir(directoryname) - this will open directory stream for you (Q1)
TextIO.openOut(filename) - this will open the file stream (Q2)</p>
<p>TextIO.openIn(filename)- this will open the file (Q2)
If you are stuck and dont' know how... |
What are some hints that an algorithm should parallelized? <p>My experience thus far has shown me that even with multi-core processors, parallelizing an algorithm won't always speed it up noticably. In fact, sometimes it can slow things down. What are some good hints that an algorithm can be sped up significantly... | <p>To gain the most benefit from parallelisation, a task should be able to be broken into similiar-sized course-grain chunks that are independent (or mostly so), and require little communication of data or synchronisation between the chunks.</p>
<p>Fine-grain parallelisation, almost always suffers from increased overh... |
jQuery Thickbox Issue <p>I'm a jQuery newb. I'm building a Online Shop and I'm using jQuery plugin 'Thickbox' (<a href="http://jquery.com/demo/thickbox" rel="nofollow">http://jquery.com/demo/thickbox</a>). The Online Shop is set up to display a 'Enlarged Image' which runs the Thickbox JS script and shows an image.</p>... | <p>in thickbox.js:</p>
<pre><code>$(domChunk).click(function(){
</code></pre>
<p>was replaced with this:</p>
<pre><code>$(domChunk).live(click, function(){
</code></pre>
|
How to implement a thread safe timer on linux? <p>As we know, doing things in signal handlers is really bad, because they run in an interrupt-like context. It's quite possible that various locks (including the malloc() heap lock!) are held when the signal handler is called.</p>
<p>So I want to implement a thread safe ... | <p>Use usleep(3) or sleep(3) in your thread. This will block the thread until the timeout expires.</p>
<p>If you need to wait on I/O and have a timer expire before any I/O is ready, use select(2), poll(2) or epoll(7) with a timeout.</p>
<p>If you still need to use a signal handler, create a pipe with pipe(2), do a b... |
Java Pattern to match any sequence of characters except a given list <p>How do I write a Pattern (Java) to match any sequence of characters except a given list of words?</p>
<p>I need to find if a given code has any text surrounded by tags like besides a given list of words.
For example, I want to check if there are ... | <p>Look-ahead can do this:</p>
<pre><code>\b(?!your|given|list|of|exclusions)\w+\b
</code></pre>
<p>Matches</p>
<ul>
<li>a word boundary (start-of-word)</li>
<li>not followed by any of "your", "given", "list", "of", "exclusions"</li>
<li>followed by multiple word characters</li>
<li>followed by a word boundary (end-... |
Creating a database from .mdf file in MS Access <p>I have a .mdf which I need to import into MS Access. I have read that .mdf is a Sql Server format so Access wont recognize it. But is there some way I can get the database created in MS Access. I am using Access 2003 and Sql Server 2005</p>
| <p>Why not right click the database in SQL Management Studio, click export and then specify the required parameter?</p>
<p>I just checked. Works in my installation of SQL Server 2008.</p>
|
Consuming XML/SOAP web service in RoR <p>I know they removed ActionService out of RoR and opted for RESTful web services. I want to know if Rails is a good choice of a framework for consuming XML/SOAP based web services. Can anyone point out some nice resources/tutorials on how to consume a SOAP based web service in RO... | <p>This is a pretty good step-by-step tutorial for soap4r: [link no longer works]</p>
|
Java: Google Maps alternative <p>I'm really tired of using the Google Web Toolkit for accessing Google Maps in Java using Netbeans... Does anybody know of a good alternative providing a simple(r) API? </p>
<p>Any help would really be appreciated!</p>
| <p><a href="http://openstreetmap.org/" rel="nofollow">OpenStreetMap</a> has a good <a href="http://wiki.openstreetmap.org/wiki/API" rel="nofollow">API</a> in combination with <a href="http://www.openlayers.org/" rel="nofollow">OpenLayers</a>.<br />
Good luck with that!</p>
<p>Driving instructions are included, but sin... |
How to make the vertical scrollbar follow the data? <p>In a VC++ 6.0 MFC of mine, I added an EditBox with Vertical Scrollbar, every 10 seconds I am reading data from serial port and I have to display through EditBox(IDC_EDIT1), I done it without any problems.</p>
<p>But one typical problem I am facing which is that, w... | <p>You will need to send the edit control an EM_SETSEL message with the length of the string as the parameters.</p>
|
JDBC generation of SQL in PreparedStatement <p>I had a really huge problem recently which took me a lot of time to debug. I have an update statement which updates 32 columns in table. I did that with PreparedStatement. Accidentaly I deleted one setParameter() call so update could not be finished successfully. </p>
<p>... | <p>Have a look at <a href="http://www.p6spy.com/" rel="nofollow">P6Spy</a>. It can intercept all your JDBC calls and log them before forwarding them onto your database.</p>
<p>Alternatively, think about using Springs JDBCTemplate which can take out alot of your boilerplate JDBC coding and help avoid these kind of mis... |
When to include a design pattern name in class name? <p>During my last project I noticed, that it is very convenient, to include design patterns names in class names. For example:</p>
<ul>
<li>ContextLazyFactory</li>
<li>RunOnceMediator</li>
<li>ThirdPartyMediator</li>
<li>MyProjectCliFacade</li>
<li>BinaryGate</li>
<... | <p>It seems natural to me in many cases:</p>
<ul>
<li>Design patterns are named to explain what they do</li>
<li>Classes are named to explain what they do</li>
</ul>
<p>When the simplest way of explaining a class's purpose is in design pattern terms, why not use it?</p>
<p>On the other hand, when the design pattern ... |
What is the use of passing const references to primitive types? <p>In a project I maintain, I see a lot of code like this for simple <code>get</code>/<code>set</code> methods</p>
<pre><code>const int & MyClass::getFoo() { return m_foo; }
void MyClass::setFoo(const int & foo) { m_foo = foo; }
</code></pre>
<p... | <p>The difference is that if you get that result into a reference yourself you can track the changes of the integer member variable in your own variable name without recalling the function. </p>
<pre><code>const &int x = myObject.getFoo();
cout<<x<<endl;
//...
cout<<x<<endl;//x might have c... |
TabPages for newly opened Windows Forms C# <p>I want to add a new tab page for every newly opened form.</p>
<p>Example:</p>
<pre><code>frmReport reportform = new frmReport();
report.Show();
</code></pre>
<p>When I open the <code>frmReport</code> form, it must be opened in a new TabPage, as in Windows Internet Explor... | <p>What you would like to achive here is to have "windows inside tab pages". This is not like it supposed to be! It looks like this:</p>
<ul>
<li>Windows OS</li>
<li>Windows of applications (Window class)</li>
<li>Containers placed on Window (for example: Panel, TabControl!)</li>
<li>Controls placed on Windows and Con... |
Component Vs Control <p>In the world of WinForms .Net controls</p>
<p>What is the difference between Component and Control?</p>
<p>Can a Control contain Components ?
Can a Component contain Controls ?</p>
| <p>A Control has all the plumbing required to act as a window. The ability to respond to Window messages (WndProc) and having a Handle being foremost. Component is missing all that. It is really rather simple, it has design time support and it can be disposed, that's about it.</p>
<p>Components still can have a run... |
C++ development on linux Code::Blocks, EMACS or GVIM <p>I am not looking for an IDE suggestion for C++ development. I have found many discussions on that and tried EMACS, GVIM and Code::Blocks. I liked Code::Blocks very much than the other two. But it looks like most of the developer community is using tools like EMACS... | <p>Whatever editor you ultimately end up using, it is worth taking a few minutes to at least learn to navigate around and perform basic editing tasks in Vim, since a vi of some flavour is the most commonly available editor in especially the more specialised distros.</p>
|
What are the most common (and often overlooked) causes of memory leaks in managed (.net) applications? <p>Please can anyone recommend a quick checklist / best practice guide to help us avoid simple (but subtle) mistakes that cause could cause memory leaks in .net apps</p>
<p>I find it difficult and quite painful to be... | <p>There are many forms of leaks:</p>
<ul>
<li>Unmanaged leaks (code that allocates unmanaged code)</li>
<li>Resource leaks (code that allocates and uses unmanaged resources, like files, sockets)</li>
<li>Extended lifetime of objects</li>
<li>Incorrect understanding of how GC and .NET memory management works</li>
<li>... |
Frames in HTML? <p>Actually...im having one left frame and one right frame....</p>
<ol>
<li><p>In Left Frame , i'm having one treeview (which is static)</p></li>
<li><p>In Right Frame , based on the click (that is based on the selected child i have to show the corresponding web page )</p></li>
</ol>
<p>How to achieve... | <p>Use a frameset</p>
<pre><code><frameset cols="150,*" frameborder="NO" marginwidth=0 marginheight=0>
<frame src="left.html" frameborder="NO" >
<frame src="right.html" frameborder="NO" name="subwindow">
</frameset>
<noframes>
<body><p>This web page uses frames.<... |
Map unknown amount of columns to Dictionary <p>I have a legacy system that dynamically augments a table with additional columns when needed. Now I would like to access said table via C#/NHibernate.<br />
There is no way to change the behaviour of the legacy system and I dynamically need to work with the data in the add... | <p>You probably need an ADO.NET query to get this data out. If you use NH, even with a SQL query using SELECT *, you'll not getting the column names.</p>
<p>You can try using SMO (SqlServer management objects, a .NET Port to the SqlServer) or some other way to find the table definitions. Then you build up the mapping ... |
Clear/Standard name for a Unit Range [0->1] <p>I'm writing a Range class at the moment and I'm looking for a good name for the common range [0->1]. If it was a vector of length 1, I would call it a Unit vector. Is there a clear name to give this range/interval? Possibly a <em>Unit Range</em>?</p>
| <p>The closed range between [0,1] is typically called the <a href="http://mathworld.wolfram.com/UnitInterval.html">closed unit interval</a>. If you do not include the endpoints it would be the open unit interval.</p>
|
Error while copying from network share "This page has an unspecified potential security flaw." <p>I recently reinstalled XP and then SP3 and I'm currently getting an error whenever I try and copy something from a network share.</p>
<pre><code>Title: Internet Explorer
Message: This page has an unspecified potential sec... | <blockquote>
<p>There's a temporary fix by adding any network ip masks to the trusted intranet zones</p>
</blockquote>
<p>That's the real fix. The error message occurs when you are trying to copy files out of the Internet Zone. And it is indeed risky if you really are dragging files out of a public-internet network ... |
how to draw line chart using Google charts <p>Why the line is starting at 100 on y-axis, Can any body solve my problem.</p>
<p>code:</p>
<pre><code><img src="http://chart.apis.google.com/chart?
chs=500x200
&amp;chd=t:533,100,423,200|179,50
&amp;cht=lc
&amp;chxt=x,y
&amp;chxl=0:|JAN|FEB|MAR|APR|MAY|... | <p>Axis 1 is the left y-Axis and with the <code>chxl</code> parameter you have specified labels of 0,20,40,60,80 and 100.</p>
<p>You could change the top value to 533 but I think this would look odd.</p>
<p>The thing to realise is that the labels work independently of the values. You change the <a href="http://code.... |
Dispose on user controls, really meant to edit the .designer.cs file? <p>For a user control with internal data structures that must be disposed, is the correct place to add that code to the Dispose method in the .designer.cs file, or is there an event or something we're meant to use instead?</p>
<p><strong>Edit</stron... | <p>If you're talking about WinForms I usually take one of two approaches to solve this problem.</p>
<p><strong>Approach 1</strong></p>
<p>Open the Form.Designer.cs file. Inside the generated dispose method I add a call to DisposeCore. I then go back to Form.cs and add a DisposeCore method that will now be called du... |
Remove project .jars from project explorer view in Eclipse <p>The list of jars just takes up too much space. Can I collapse it or hide it?</p>
| <p>Another solution would be using the Package Explorer view.</p>
|
What is a correct way to initiate user control from code behind <p>Basically I want to create a user control in code behind, DataBind() it and then insert the control into current page</p>
<p>I'm currently trying this:</p>
<pre><code>var comment = new IncidentHistoryGroupComment();
comment.LoadControl("~/Controls/Inc... | <pre><code>MyControl myControl = (MyControl)LoadControL("~/MyControl.ascx");
</code></pre>
<p>I changed the name of your control for readability.</p>
|
Merge two arrays (key and content) in PHP <p>I have an array like the following</p>
<p>Array ( [0] => "txt1" [1] => "txt2" [2] => "txt3")</p>
<p>I have another array like it but with different content :
Array ( [0] => on [2] => on)</p>
<p>The aim is to get a final array with the keys of the second and the content ... | <p>The easiest way to do this is with <code>array_intersect_key</code> (<a href="http://ca.php.net/manual/en/function.array-intersect-key.php" rel="nofollow">See the PHP Docs</a>). It grabs the values from the first array passed corresponding to the keys present in all other arrays passed.</p>
<p>So, your example woul... |
how do I print an unsigned char as hex in c++ using ostream? <p>I want to work with unsigned 8-bit variables in C++. Either <code>unsigned char</code> or <code>uint8_t</code> do the trick as far as the arithmetic is concerned (which is expected, since AFAIK <code>uint8_t</code> is just an alias for <code>unsigned char... | <p>I would suggest using the following technique:</p>
<pre><code>struct HexCharStruct
{
unsigned char c;
HexCharStruct(unsigned char _c) : c(_c) { }
};
inline std::ostream& operator<<(std::ostream& o, const HexCharStruct& hs)
{
return (o << std::hex << (int)hs.c);
}
inline HexChar... |
How can i use MYSQL database connection in iphone application useing cocos2d? <p>I am working on project and i need to connect MYSQL database. I am success to connect SQLite in my project ( using cocos2d).But i can not connect MYSQL database in my project.
I any one do like this than help me for how to connect . Give m... | <p>You will not be able to connect to MySQL directly from the iPhone. You <strong>must</strong> use some intermediate layer such as a Web application with PHP.</p>
<p>So, you will have something like this:</p>
<ol>
<li>iPhone POSTING a request to the WebServer using HTTP</li>
<li>Web Server connecting to the MySQL da... |
Assembly to Bytes <p>My scenario - I am trying to send a Assembly File from Server to Client (via direct TCP connection). But the major problem is- how do I convert this Assembly to bytes to that it can be readily transferred?
I used following - </p>
<pre><code>byte[] dllAsArray;
using (MemoryStream stream = new Memor... | <p>Wouldn't that just be the raw dll contents, as though you had saved it to disk? i.e. the equivalent of <code>File.ReadAllBytes</code>?</p>
<p>It sounds like the dll is generated - can you save it anywhere? (temp area, memory stream, etc)?</p>
<p><strong>edit</strong> Since it seems you are using code-dom, try usin... |
ASP.Net Custom controls vs. user controls: Are these two the same <p>If they are different, under what circumstances should we decide to use either approach?</p>
<p>Also, what is the advantage of ascx over aspx?</p>
| <p>user controls are a form of custom control, that gives you a visual designer. They are ideal for use when you want a reusable control within the same web site. (It is possible to create and package user controls as seperate assemblies but that is beyond the scope of this question and I know has been asked on SO). </... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.