input stringlengths 51 42.3k | output stringlengths 18 55k |
|---|---|
serializing generic XML data across WCF web service requests <p>I've got a web app that sends a request to a WCF service. The WCF service gets a LINQ resultset (anon. ilist) and sends that in reply, back to the web app.
In order to get it working quickly, inside the WCF app, i'm using <a href="http://blogs.msdn.com/ac... | <p>The only problem with sending datasets over WCF is that it isn't interoperable - i.e. you wouldn't be able to use the dataset from a non-.NET client.</p>
<p>I've worked in several large applications that send Datasets across the wire via WCF just fine. As long as both the sender and receiver run on .NET you should... |
How do I access the onresize event from a SharePoint Web Part? <p>I have some JavaScript that will execute within a SharePoint web part. I would like to have a function execute when the window is resized. Normally I would use</p>
<pre><code><html>
<body onresize="resizeFunction();">
</body>
<... | <p>You might consider using an external javascript library such as jQuery or prototype, etc.</p>
<p>For example, in jQuery, you might try (untested code!!)</p>
<pre>
$("window").bind("resize", "myFunctionName");
</pre>
<p>jQuery docs: <a href="http://docs.jquery.com/Events/bind" rel="nofollow">http://docs.jquery.com... |
Environ Function code samples for VBA <p>I am looking for some information or code samples for the <code>Environ</code> Function in VBA to grab the username on the current system.</p>
| <p>Environ() gets you the value of any environment variable. These can be found by doing the following command in the Command Prompt:</p>
<pre><code>set
</code></pre>
<p>If you wanted to get the username, you would do: </p>
<pre><code>Environ("username")
</code></pre>
<p>If you wanted to get the fully qualified na... |
VisualStudio: no debug output <p>I'm trying to debug a C# application. The method:</p>
<pre><code>System.Diagnostics.Debug.WriteLine("something");
</code></pre>
<p>should do the work, but in the Output window (set to "debug" and with all the options activated) I can't see a single line I'm trying to write. Any idea?
... | <p>There's an option under Tools-Options-Debugging-General, Redirect all Output Window text to the Immediate Window. Make sure that's disabled. However, by default it isn't, so I doubt that's your issue. You can also just check your Immediate Window to see if it's outputting there.</p>
<p>You might also want to try... |
PHP MySQL Joining Tables <p>I'm trying to create a directory and I have two tables, entry and location. Each entry will be able to have multiple locations so I'm assuming the best idea (correct if wrong) is to create a third table where I specify 'links'. Example:</p>
<pre><code>Marly:France
Karla:Argentina
Smith:USA
... | <pre><code>SELECT `entry`.*
FROM `entry`
JOIN `entry-locations` ON `entry-locations`.`entry-id` = `entry`.`name`
WHERE `entry-locations`.`location` = 'Aberdeen'
$res = mysql_query('all-that-stuff-above');
while($row = mysql_fetch_assoc($res)) {
echo $row['name'] . "\n";
}
mysql_free_result($res);
</code></pre>
|
Why does LINQ to Entities not support SingleOrDefault()? <p>Any ideas why LINQ to Entities doesn't support <code>SingleOrDefault()</code> but instead ask to use <code>FirstOrDefault()</code>?</p>
<p>Will <code>SingleOrDefault()</code> functionality be replaced? By what?</p>
| <p>I'm not sure why it was left out, but you can always roll your own.</p>
<p>I found a similar response to this question on MSDN, here is an implementation based off of that code.</p>
<pre><code>public static TElement SingleOrDefault<TElement>
(this IQueryable<TElement> query)
{
if (query.Count... |
$stdin compatibility with std::istream using swig, C++, and Ruby <p>I have a function in C++ that takes in an std::istream as the input:</p>
<pre><code>class Foo {
Foo(std::istream &);
}
</code></pre>
<p>Using SWIG, I've bound it to Ruby, but Ruby's $stdin variable is fundamentally different from anything lik... | <p>You can use an instance of std::istream that implements its operations with Ruby methods on $stdin called through the C interface (e.g., using rb_funcall). You can't do it by deriving a class from std::istream itself, because its methods are not virtual; instead you'll need to derive from std::stream_buf and instant... |
PHP: Get array of text from perticular XML node type? <p>I am not totally new to PHP or XML but I am 100% new to paring XML with PHP. I have an XML string that has several nodes but the only ones I am insterested in are the < keyword > nodes which there are an uncertain number of each containing a phrase like so: &l... | <blockquote>
<p>This turns $keywords into an array of
Objects. Is there a way to get the
text from the objects?</p>
</blockquote>
<p>Sure, see this.</p>
<pre><code>$dom = domxml_open_mem($str);
$keywords = $dom->get_elements_by_tagname('keyword');
foreach($keywords as $keyword) {
$text = $keyword->ge... |
Accessing Page Class From Another Page Class <p>How do I access a page class from another class. For example I have:</p>
<pre><code>public partial class MyPage : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{ }
}
</code></pre>
<p>Why can I not access it from another class in App_C... | <p>I see nothing wrong with your code as posted, most likely you've got a <strong>namespace</strong> problem. </p>
<p>edit: gah, just noticed that you mentioned this was a website project. It's been a while since I deigned to start one of those :) but I believe this stems from the fact that App_Code is run-time compil... |
SQL Query -- update many records from 1 record in same table <p>We've got a table of places. The same place may occur multiple times in our table (bad design, not our choice). We had someone go through and find addresses for each of these places. They only updated one of the many instances of each place.</p>
<p>Her... | <pre><code>update places set address1 = places2.address1
from places inner join places places2 ON places.placename = places2.placename
where (places2.address1 <> '' AND places2.address1 is not null)
</code></pre>
|
Testing input fields not available for web service in Visual Web Developer Express <p>I have a web service that I am trying to test in Visual Web Developer Express Edition (Service Pack 1). I am working with two different websites on two different branches from an SVN repository but largely the same code. The web ser... | <p>You only get the fields when HTTP POST is available as a submission option, if you have complex types in your submission parameters then HTTP POST may not be able to handle them and as such won't be enabled... then the fields won't be present on the helper page.</p>
|
Is there any way to ensure a function is compiled JIT? <p>I have a function that I want to be sure is compiled JIT (i.e. right before it's called). Are there attributes or assembly settings that will ensure this? If not, then how can I guarantee that a function is compiled JIT?</p>
<p>Thanks!</p>
<p><strong>EDIT:</st... | <p>If I read this correctly, you are worried about errors occurring when a class/method is first compiled. This requires awareness of the boundaries. It is obtainable with an extra layer.</p>
<p>If something is 'wrong with SuspectType (ie a required assembly not loading), the try/catch in the following is of no use be... |
Why and how would you use Exceptions in this sample PHP code? <p>I've been wondering why would I use Exceptions in my PHP. Let's take a look at a simple example:</p>
<pre><code>class Worker
{
public function goToWork()
{
return $isInThatMood ?
// Okay, I'll do it.
true :
// In your dreams...
false;
}
}
... | <h2>When should I use an exception?</h2>
<p>You use an exception to indicate an <strong>exceptional</strong> condition; that is, something which prevents a method from fulfilling its contract, and which shouldn't have occurred at that level.</p>
<p>For example, you might have a method, <code>Record::save()</code>, wh... |
How to Sort In-Memory XML with Microsoft XMLDOM? <p>Besides using XSLT...</p>
<p>How to Sort In-Memory XML with Microsoft XMLDOM?</p>
| <p>I'm not familiar with any method other than using XSLT to sort XML.</p>
<p>Why is XSLT not an option? It's simple and should not a performance buster. You can cache the FreeThreadedDOMDocument object once it has loaded the XSLT document to avoid parsing and compiling the XSLT document each time.</p>
|
What tool(s) can I use to produce iPhone App Screencasts? <p>I need to produce demonstration video screencasts for my iPhone app... I'm referring to those such as <a href="http://www.reddit.com/iphone/">this one</a> for the Reddit iPhone app (the one on the right, not the YouTube video). </p>
<p>I'm assuming the best ... | <p>For my screencast <a href="http://www.sunsetlakesoftware.com/picubed">here</a>, I ran the application in the iPhone Simulator and recorded it all using <a href="http://www.telestream.net/screen-flow/overview.htm">ScreenFlow</a>. I can't recommend ScreenFlow highly enough, as it really simplifies the whole process. ... |
Facebook Content and Ownership <p>I am working on an app that imports photos from facebook. It creates a few "auto albums" for the users including one called "Photos of Me", which I think is pretty self explanitory (Yes, the "photos you're tagged in" one, provided by facebook).</p>
<p>Anyway, how do I deal with owners... | <p>This functionality already exsits within Facebook, as an album that I believe is called "Tagged Photos." Also, your question makes it sound like it either stores them off-Facebook or off-line on the user's computer. This is another grey area, since any photos the user is in the user didn't take, and likely doesn't... |
ClickOnce in Release mode doesn't publish <p>Just doing some testing/prototyping with ClickOnce. Does anyone know why I can publish with CLickOnce when its set to 'debug' mode but not when its set to 'release' mode? </p>
<p>I dont even get an error message for the latter. The output folder remains empty as nothing has... | <p>Sorry no, but you should try to both create a new config that copies the settings from the Release config and try to publish that one. Or even create a new config from scratch that sets the same flags as the release config. </p>
<p>If any of those work you might even remove the Release one and rename the new one to... |
Where is user specified data being stored on MacOS <p>I install an app .app file to /Applications folder.
Can you please tell me where does the user specified data being stored? How can I do to clean uninstall my application and its user specific data?</p>
<p>Thank you.</p>
| <p>This depends on the application, unfortunately. Sometimes it is in ~/Library/ folder, though.</p>
|
accepts_nested_attributes_for child association validation failing <p>I'm using accepts_nested_attributes_for in one of my Rails models, and I want to save the children after creating the parent.</p>
<p>The form works perfectly, but the validation is failing. For simplicity's sake imagine the following:</p>
<pre><cod... | <p>Use <code>:inverse_of</code> and <code>validates_presence_of :parent</code>. This should fix your validation problem.</p>
<pre><code> class Dungeon < ActiveRecord::Base
has_many :traps, :inverse_of => :dungeon
end
class Trap < ActiveRecord::Base
belongs_to :dungeon, :inverse_of => :tr... |
Render HTML table on Windows Mobile 6.0 <p>I am trying to render a HTML table to display on Windows Mobile 6.0 device. I use Mobile Device Emulator to view the output. Here is my html, am I missing something? The table display each cell on it own row.</p>
<pre><code><?xml version="1.0" encoding="UTF-8"?>
<!DO... | <p>Try changing the View mode of the browser.</p>
<p>Windows mobile will try to "optimize" table layout if you use the default "<em>Single Column</em>" (or it might be called "One Column") view.</p>
<p>You should make sure the browser is set to use "<em>Desktop</em>" mode or else the columns will display incorrectly.... |
Atomically copying one MySQL table over another? <p>I am trying to copy one table over another one "atomically". Basically I want to update a table periodically, such that a process that reads from the table will not get an incomplete result if another process is updating the table.</p>
<p>To give some background inf... | <p>Use <a href="http://dev.mysql.com/doc/refman/5.0/en/rename-table.html">rename table</a></p>
<pre><code>RENAME TABLE old_table TO backup_table, new_table TO old_table;
</code></pre>
<p>It's atomic, works on all storage engines, and doesn't have to rebuild the indexes.</p>
|
.NET 3.5 and SP1 install question - single installer <p>Does this install .NET 3.5 and SP1?<br />
<a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=ab99342f-5d1a-413d-8319-81da479ab0d7&displaylang=en" rel="nofollow">http://www.microsoft.com/downloads/details.aspx?FamilyID=ab99342f-5d1a-413d-8319-81d... | <p>lower on page</p>
<p>Full Package
To download the full package, rather than the bootstrapper, click on the link below:
<a href="http://download.microsoft.com/download/2/0/e/20e90413-712f-438c-988e-fdaa79a8ac3d/dotnetfx35.exe" rel="nofollow">http://download.microsoft.com/download/2/0/e/20e90413-712f-438c-988e-fdaa79... |
Calling JAX webservices from php is not working <p>I am trying to call Java webservices developed using JAX-WS 2.1.4 from php but it doesnt seem to work as expected. All the parameter values being passed to the method has been intrepreted as "null" value, but i am passing the proper values from php side.</p>
<p>Can an... | <p>try</p>
<p>$soapObj->method(array('arg0' => 'test', 'arg1' => 'test, 'arg2' => 1));</p>
|
Creating a logging handler to connect to Oracle? <p>So right now i need to create and implement an extension of the Python logging module that will be used to log to our database. Basically we have several python applications(that all run in the background) that currently log to a random mishmash of text files. Which m... | <ol>
<li>If errors occur with cx_Oracle, it's probably best to log these to a text file.</li>
<li>You could try redirecting sys.stdout and sys.stderr to file-like objects which log whatever's written to them to a logger.</li>
<li>I would guess you do want to commit after each event, unless you have strong reasons for n... |
How can I use Server.MapPath() from global.asax? <p>I need to use <code>Server.MapPath()</code> to combine some files path that I store in the <code>web.config</code>.</p>
<p>However, since <code>Server.MapPath()</code> relies on the current HttpContext (I think), I am unable to do this. When trying to use the method... | <p>You could try <a href="http://msdn.microsoft.com/en-us/library/system.web.hosting.hostingenvironment.mappath.aspx">System.Web.Hosting.HostingEnvironment.MapPath()</a>.</p>
<p>No HttpContext required.</p>
|
Read only "N" bytes from a file in Cocoa <p>How to read only "N" bytes from a specified file?</p>
| <p>If you want random access to the contents of the file in a manner similar to having loaded it via NSData but without actually reading everything into memory, you can use memory mapping. Doing so means that the file on disk becomes treated as a section of virtual memory, and will be paged in and out just like regular... |
Designing a main form ("main menu") for a WinForm application <p>The form that currently loads during when our beta WinForm application starts up is one that shows a vast array of buttons... "Inventory", "Customers", "Reports", etc. Nothing too exciting.</p>
<p>I usually begin UI by looking at similar software produ... | <p>I have found that given no option, users will have a hard time to say what they want. Once given an option, it's usually easier for them to find things to change. I would suggest making some paper sketches of potential user interfaces for you application. Then sit down with a few users and discuss around them. I wou... |
Nested UpdatePanel Behavior <p>I am using a Wizard control in an UpdatePanel. Some of the Wizard Steps have UpdatePanels nested inside. Both the outer and inner UpdatePanels have their own Trigger collection. All of the events fire as intended. </p>
<p>However, the triggers for the outer UpdatePanel do not set off... | <p>Are you associating the UpdateProgress with your nested UpdatePanel?</p>
<p>Can you provide your full tags for the UpdatePanels and UpdateProgress? It would help to see if there is something obvious.</p>
|
Is there a way to modify a Microsoft Word footer using Apache POI? <p>I need to modify the content of a Word footer using a Java API.</p>
<p>The <a href="http://poi.apache.org/" rel="nofollow">Apache POI</a> project <a href="http://poi.apache.org/apidocs/index.html" rel="nofollow">does not</a> <a href="http://poi.apac... | <p>Can't speak for POI but <a href="http://www.aspose.com/categories/file-format-components/aspose.words-for-.net-and-java/default.aspx" rel="nofollow">Aspose.Words</a> will let you manipulate Doc files. It ain't cheap though.</p>
|
Delete Files and Folders Issue <p>My project is a Web project built using three technologies :</p>
<ol>
<li><p>Icefaces for presentation layer.</p></li>
<li><p>Spring for business layer.</p></li>
<li><p>Hibernate for data access layer.</p></li>
</ol>
<p>My Project deployed on WebSphere 6.1 and the user can upload fil... | <p>In answer to your second question:</p>
<p>WebSphere has a facility for creating worker threads and arranging for them to be initiated according to a schedule. This approach is fully supported in WebSphere - you don't violate any Java EE restrictions on thread creation by using it.</p>
<p>Search for Aysynchronous B... |
How to resize image in C# without smoothing <p>How do you re-size a black and white image without any smoothing affect? I have a BarCode that is an image that is too big. I need to resize the image but with one caveat. The resulting image needs to be the same proportional size and the black and white bars can not t... | <p>@arul is correct. To be specific,</p>
<pre><code>graphics.SmoothingMode = SmoothingMode.None;
graphics.DrawImage( barCodeImage, new Point( 0, 0 ) );
</code></pre>
<p>You might also want to check out the InterpolationMode, to see whether changing this value gives you results closer to what you want.</p>
|
Assignments failing <p>I'm debugging part of a large project in Visual Studio 2005, and stepping through the code line by line. </p>
<pre><code>int speed = this->values.speed;
int ref = this->values.ref_speed;
</code></pre>
<p>After stepping past the first line, values.speed has a value of 61, but for some reas... | <p>This could happen if the definition of the values structure got changed in a header file and not all the object files got recompiled. Then the "map" of the structure your code in this file is using might not match the rest of the code's. That could explain why one of the variables appears to have the other's value.<... |
Make mysql_fetch_assoc automatically detect return data types? <p>When using mysql_fetch_assoc in PHP, how can I make it return the correct data types? Right now it appears to convert everything to strings, I'd prefer if it left the Ints as Ints, and somehow designated the Date/Time as either Object or somehow differen... | <p>I think a good strategy here is to programatically determine the datatype of each column in a table, and cast the returned results accordingly. This will allow you to interact with your database in a more consistent and simple manner while still giving you the control you need to have your variables storing the cor... |
Hibernate - Selecting across multiple joins with collections <p>I'm having trouble getting a hibernate select to return a correctly populated object graph, when the select contains joins across many collections.</p>
<p>Eg:</p>
<pre><code> String sql = "select distinct changeset " +
"from Changeset changeset " +
... | <p>Marty:</p>
<p>I had this same problem and I could not find a suitable solution. You can use simple result transformers to control the number of objects that are returned:</p>
<pre><code>CriteriaSpecification.ROOT_ENTITY
CriteriaSpecification.DISTINCT_ROOT_ENTITY
</code></pre>
<p>But the objects would always conta... |
Threading in Java EE webapps <p>I am curious about how the following concepts typically execute inside a Java EE container, is one instance created per request, or does one instance serve all requests?</p>
<ul>
<li>Servlets</li>
<li>Tags</li>
</ul>
<p>I want to know this because lately i have been using a lot of Stri... | <p>Both are correct. The container may reuse old instances for new requests and even create new instances if more requests are to be served.</p>
<p>Using StringBuilder should be safe as long as its usage does not cross the instances boundaries (by static usage, returning StringBuilders etc.).
So if you're using it whi... |
If SOA is dead, what's replacing it? <p>Please forgive me if this question is dense.</p>
<p><em>Background:</em> We have several internal applications that integrate at the database. We are looking at how to break that up, and it seems like moving to an architecture where each application exposes its functionality th... | <p>SOA is a clever idea, but an enormous hype around it made people writing "SOA IS NOW DEAD". This is not true, just as sentence "Structural programming is dead everybody do OOP now!" is also not always true: sometimes structural code is the only option, but the decision should be made on evaluation, and not on hype.
... |
C#: Access SQL view through generic RepositoryBase class? <p>I'm using a RepositoryBase<T> base class as the foundation for my individual repositories (e.g. UserRepository).</p>
<p>It simplifies things like adding new entities etc. for example:</p>
<p><code></p>
<pre><code>public IQueryable<T> SelectAll()
{... | <p>If it's a special one-off case, you could do:</p>
<pre><code>if (typeof(T) == typeof(User))
{
return db.GetView<UserActive>().AsQueryable<UserActive>();
}
else
{
return db.GetTable<T>().AsQueryable<T>();
}
</code></pre>
<p>This of course makes an assumption on how you would access y... |
ASP.Net MVC with web service as model? <p>Does anyone have advice or tips on using a web service as the model in an ASP.Net MVC application? I haven't seen anyone writing about doing this. I'd like to build an MVC app, but not tie it to using a specific database, nor limit the database to the single MVC app. I feel a w... | <p>How likely, or useful, is it for your MVC app to be decoupled from your database? How often have you seen, in your application lifetime, a change from SQL Server to Oracle? From the last 10 years of projects I've delivered, it's never happened.</p>
<p>Architectures are like onions, they have layers of abstractions ... |
A question about referencing functions in Javascript <p><strong>The problem:</strong> I have a jQuery heavy page that has a built in admin interface. The admin functions only trigger when an admin variable is set. These functions require a second library to work properly and the second file is only included if the user... | <p>The code should operate without error, since the admin functions without implementation will not be called. The only thing that is really being wasted is bandwidth to transmit the admin code that is not used.</p>
<p>However, let me caution against security through obscurity. If the user were to view this code and s... |
Nullable value types <p>If a value type is declared nullable, how should I take precautions for this? I.e. if in the constructor I have:</p>
<pre><code>public Point3 ( Point3 source )
{
this.X = source.X;
this.Y = source.Y;
this.Z = source.Z;
}
</code></pre>
<p>would it fail, if source was null?</p>
| <p>I don't see the possibility of <code>Point3</code> being <code>null</code> if it's a value type. Don't you miss a question mark? And if you really mean <code>Point3?</code>, then you should access it like:</p>
<pre><code>public Point3 ( Point3? source )
{
this.X = source.Value.X;
this.Y = source.Value.Y;
... |
Locating text and performing operation based on its existence <p>I'm trying to learn jQuery, but it's coming slowly as I really don't know any JavaScript. </p>
<p>My site is in VB.NET and I'm putting jQuery code on both my actual <code>.ascx</code> <code>UserControl</code> and in a separate file (something like <code>... | <p>I am completely ignorant of the ASP.NET side of it, but as far as jQuery and Javascript....</p>
<p>To get the value of a text field, you use the jQuery function <a href="http://docs.jquery.com/Attributes/val" rel="nofollow"><code>val()</code></a>:</p>
<pre><code>var value = $('#mytextbox').val();
</code></pre>
<p... |
Cocoa MySQL Framework pointers and/or advice? <p>Hey, I'm looking to find a good MySQL framework for Cocoa that I can use in my XCode projects to access a database on the web. Do you know of any good, open source/free ones? I have looked at http:// mysql-cocoa.sourceforge .net/index.html but haven't had a chance to pl... | <p>You almost answered your own question! Take a look at <a href="http://mysql-cocoa.sourceforge.net/" rel="nofollow">MySQL-Cocoa</a>. </p>
<p>I've had a good experience wrapping simple queries in NSOperation objects for easy multi-threading.</p>
|
How advisable is not having a message loop in WinMain? <p>This may be the simplest win32 program ever ..</p>
<pre><code>#include <windows.h>
int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR cmdLine, int show)
{
MessageBox(0, "Hello world..", "Salutations!", MB_OK);
return 0;
}
</code></pre>
<... | <p>Just a technicality, but you do have a window, and you do have a message loop, just not in your code.</p>
<p>The call to <code>MessageBox()</code> creates a window (of class #32770) and runs a local message loop, not returning to your code till the message loop drops out, presumably when <code>WM_NCDESTROY</code> i... |
How to get NMEA from the GPS Device? <p>im trying to read the current position of GPS Device...using N95 from Nokia.
I read tht i will need my device to return the NMEA lines to the serialport and then i will parse/split it to get things I want but all along I dont know what to write to the serialport to make device re... | <p>I found this site <a href="http://www.simplehelp.net/2008/10/22/how-to-share-the-gps-in-your-n95-with-your-laptop-via-bluetooth-in-linux/" rel="nofollow">site</a> which seems to guide you through everything you need to do.</p>
|
Resolve a COM [out] VARIANT* containing parray as SAFEARRAY of BSTR's in c#.net <p>Question: I have a COM server with a method as IDL:</p>
<pre><code> [id(2), helpstring("method ExtractAvailableScanners")]
HRESULT ExtractAvailableScanners(
[in] VARIANT scanFilter, [out] VARIANT* scanPresent,
... | <p>It looks like your C++ implementation is wrong. You do not set <code>retVal</code> anywhere, also you are copying the wrong value into <code>scanPresent</code>. The calling code has no way of knowing you allocated it using <code>new</code>, and since it is C#, it would have no way of freeing it even if it did. Norma... |
ASP.NET MVC Authorize Attribute - NOT WORKING! <p>Hey guys, I'm a bit frustrated here. I'm not quite sure what's going on. I started with the default MVC Project Template and proceeded to add a Controller ...</p>
<pre><code>public class TestTemplatesController : EVController<EvTestTemplate>
{
//
// GET... | <p>Okay, I feel like an idiot. It helps if you add the Authorize Attribute on the correct Controller. :) It's been a long day ...</p>
|
CBT Hook not working in Windows Vista <p>I am trying to use a CBT hook to receive HCBT_MOVESIZE notifications. It works fine for all applications when I run my program from a folder on my desktop. When I install the application to the "Program Files" or "Program Files (x86" folder I only receive notifications for my o... | <p>Might be a UIPI issue:</p>
<blockquote>
<p>User Interface Privilege Isolation
(UIPI) implements restrictions in the
windows subsystem that prevents
lower-privilege applications from
sending window messages or <strong>installing
hooks</strong> in higher-privilege processes.</p>
</blockquote>
<p>from Mic... |
How to escape SQL keywords in JPAQL <p>I would like to have an entity named "GROUP" in my JPA setup. Now I get problems when I try to perform JPA queries, like "select count(group_.id) from Group group_". </p>
<p>JPA thinks this is a misplaced GROUP BY attempt and complains. Is there a way I can escape "Group", or do ... | <p><strong>please don't do it!</strong> </p>
<p>rename your table to something else, you'll thank me in the long run. Don't use any reserved words for table or column names!</p>
<p>name it something like EmployeeGroup, JobGroup or ObjectGroup, etc...</p>
|
Best Regular Expression for Email Format Validation with ASP.NET 3.5 Validation <p>I've used both of the following Regular Expressions for testing for a valid email expression with ASP.NET validation controls. I was wondering which is the better expression from a performance standpoint, or if someone has better one.</p... | <p>If you're wondering why this question is generating so little activity, it's because there are so many other issues that should be dealt with before you start thinking about performance. Foremost among those is whether you should be using regexes to validate email addresses at all--and the consensus is that you sho... |
UIWebView didn't quite finish loading <p>I have pushed a view onto my nav controller that contains a UIWebView and this will load a URL.</p>
<p>When it starts I kick off the networkActivityIndicatorVisible and when it finishes I hide it. </p>
<p>If a user decides he does not want to finish loading the web page and h... | <p>In the viewWillDisappear: method of your UIWebView's ViewController, do this</p>
<pre><code>if([yourWebView isLoading]){
//hide your network activity indicator
[yourWebView stopLoading];
}
</code></pre>
<p>Hope that helps</p>
|
Python recursion and return statements <p>I'm fairly new to Python and recursive functions as a whole, so pardon my ignorance.</p>
<p>I am trying to implement a binary search tree in Python and have the following insert method (taken out of a class):</p>
<pre><code>def insert(self, key, root=None):
'''Inserts a n... | <p>On your recursive lines, you do not return anything. If you want it to return 0, you should replace them with lines like:</p>
<pre><code>return self.insert(key, root=tmp.left)
</code></pre>
<p>instead of just</p>
<pre><code>self.insert(key, root=tmp.left)
</code></pre>
|
Can you have a Dynamic Data Field which consists of a list of fields? <p>This is a purely theoretical question (at least until I start trying to implement it) but here goes.</p>
<p>I wrote a web form a long time ago which has a configurable section for getting information. Basically for some customers there are no fi... | <p>Did you try creating a FieldTemplate that had a "ListView" of all the Fields? (the ListView would use Dynamic Data to determine which FieldTemplate to display for each field.)</p>
<p>I don't see why this would not be possible. Although, "out of the box", you may have to hit "edit" on each row of the new FieldTemp... |
XML question in SQL Server <p>In one of my sql scripts, I need to execute a stored procedure with the following xml string</p>
<pre><code><Collection xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Field>
<Attributes>
<Attribute N... | <p>The XML datatype actually can be modified using XQuery. See <a href="http://msdn.microsoft.com/en-us/library/ms187093.aspx" rel="nofollow">the modify() method</a>.</p>
<pre><code>declare @x XML;
select @x = N'<Collection xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001... |
Browse path / click-though issue <p>I have Raize 3.0 installed in D2007. For whatever reason, I can't seem to get the Ctr-click to work for loading up it's units, even though that feature works fine on all my other Delphi and Third-Party components.</p>
<p>Here's what I have for Raize on the Library Path:</p>
<pre><c... | <p>For lib path you generally don't need source files. I use:</p>
<blockquote>
<p>C:\Program Files\Raize\RC4\Lib\BDS2007</p>
</blockquote>
<p>For browsing path you need to specify the language directory, e.g.:</p>
<blockquote>
<p>C:\Program Files\Raize\RC4\Source\Lang\English</p>
</blockquote>
<p>If this doesn... |
how to do OR search in nutch? <p>Say,search for results whose Field is 'A' or 'B'?</p>
<p>it seems the default is AND.</p>
| <p>Never worked with Nutch actively, but since it's based on Lucene, shouldn't Lucene's rules apply? That is to say, the <a href="http://lucene.apache.org/java/2%5F3%5F2/queryparsersyntax.html#Boolean%20operators" rel="nofollow">Query Parser Syntax</a> should be applicable. See if this helps.</p>
|
Delete an object and all of its related entities in Entity Framework <p>Does anyone know how to delete an object and all of its related entities inside of EF without manually traversing the object graph and deleting each one?</p>
<p>For example, I've got SalesOrder and SalesOrderDetails with a 1:N relationship between... | <p>You should not be doing this in the Entity Framework. All popular relational databases support <code>ON CASCADE DELETE</code> on foreign keys which is a lot more efficient as well. I suggest you just go with that.</p>
|
Architecture for Satellite Parts of a Larger Application <p>I work for a firm that provides certain types of financial consulting services in most states in the US. We currently have a fairly straightforward CRUD application that manages clients and information about assets and services we perform for each. It only con... | <p>Start with the <a href="http://en.wikipedia.org/wiki/Strategy%5Fpattern" rel="nofollow">Strategy</a> design pattern, which basically allows you outline a "placeholder", to be replaced by concrete classes at runtime. </p>
<p>You'll have to sketch out a clear interface between the core app and the "plugins", and you... |
how to use inittab to auto-restart a PHP programme? <p>Seems it has a respawn parameter,</p>
<p>But I haven't figured out how to use it.</p>
| <p>Such as</p>
<pre><code>mine:234:respawn:/usr/local/bin/myscript
</code></pre>
<p>See this page for a good explanation</p>
<p><a href="http://aplawrence.com/Unixart/startup.html" rel="nofollow">http://aplawrence.com/Unixart/startup.html</a></p>
<p>A more verbose example:</p>
<pre><code># Level to run in
id:2:ini... |
Best free way to store 20 million rows a day? <p>Daily 20-25 million rows that will be removed at midnight for next days data. Can mySQL handle 25 million indexed rows? What would be another good solution?</p>
| <p>You give very little information on the context but sometimes <em>not</em> using a database and instead a binary/plain text file is just fine and can -- depending on your requirements -- be much more efficient and maintainable. e.g if it's sensor data storing it in a binary file with each record at a known offset co... |
Interface design? Can I do it iteratively? How should I handle changes to the interface? <p>What is the best approach for defining Interfaces in either C# or Java? Do we need to make generic or add the methods as and when the real need arises?</p>
<p>Regards,
Srinivas</p>
| <p>Once an interface is defined, it is intended to <strong>not</strong> be changed.
You have to be thoughtful about the purpose of the interface and be as complete as possible. </p>
<p>If you find the need, later, to add a method, really you should define a new interface, possibly a _V2 interface, with the additiona... |
Why is my override protected function createChildren being ignored? <p>Here is the error:<pre>
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at view::ScoreBoard/setChipCount()[C:\Flex Builder 3\StackOverflowQuestion\src\view\ScoreBoard.as:32]
at model::MainDe... | <p>I think you're confusing the order of instantiation. Namely, if you want to use setChipCount after the children of the component have been initialized, you should wait for the initialize event to fire, i.e.:</p>
<pre><code> public dynamic class MainDeckScoreBoard extends ScoreBoard {
...
public fu... |
App That Uses SDK BSODs in Delphi 2007 But Works in C# <p>I'm coding an application that uses a third party SDK (OCXs). I use the SDK in C# and it works just fine. However, I can create the simplest test application with the same objects from the SDK in Delphi 2007 and it compiles ok, but BSODs on the same machine wh... | <p>Very unusual problem. Windows NT based OS's are normally very good at containing faults that occur at Ring 3 inside of user applications. Does the SDK in question interact with hardware through kernel level drivers? Also, what information appears on screen when the system BSOD's. Sometimes this is a clue as to the n... |
rhino mocks with singleton <p>I'm using component from a third party. The component provide a singleton pattern for context into our application. I'm using on my side this singleton but I would like to mock this object for my test. Is there any way to accomplish a mock on this object.</p>
<p>Also, the constructor is d... | <p>With RhinoMocks you have to have an interface. If you really need to mock this, then you will have to cheat a bit by wrapping the singleton in another class that instantiates an interface. This interface needs to basically be a carbon copy of all public members on the third party singleton type.</p>
<p>The concept ... |
Routing vs Url Rewrite (IIS7) Performance <p>I was wondering is there any difference in terms of performance between the two approaches? Any good articles on this?</p>
| <p>Lets think about the difference in what's actually happening:</p>
<p>URL rewriting:</p>
<ul>
<li>IIS receives request and passes it to unmanaged module</li>
<li>Module matches the request against a set of patterns and returns a transformation</li>
<li>IIS passes the returned transformation to the ASP.NET module an... |
How to access xml text node in Jquery <p>Suppose I get the following XML structure:</p>
<pre><code><root>
<item>
<item1>text1</item1>
<item2>text2</item2>
more text here
</item>
</root>
</code></pre>
<p>"more text here" is a text node that is at the same level as the... | <p>I came up with the same solution:</p>
<pre><code> var xml = $("<root><item1>text1</item1><item2>text2</item2>more text here</root>");
alert($(xml).contents().empty().end().text());
</code></pre>
|
access overloaded operator in c++ <p>I have overloaded the [] operator in my class. here is the implementation</p>
<pre><code>Node* List::operator [](int index) const{
Node* p = head_;
for (int i = 0; i < index; i++){
p = p->link();
}
return p;
}
</code></pre>
<p>I have another fun... | <pre><code>(*this)[n]
</code></pre>
|
what are the pros & cons of Git and Hg Version Control System? <p>I am now in a condition to choose which Version Control System, so I would like to get some comment from experience developers who have used these.
Which one i should use and in what condition?</p>
| <p>Google Code recently chose Mercurial over Git for their system. In their analysis they found that Mercurial </p>
<ul>
<li>had an easier learning curve</li>
<li>had good Windows support</li>
<li>was easier to maintain</li>
<li>ran faster over HTTP</li>
</ul>
<p>see <a href="http://code.google.com/p/support/wiki/DV... |
GWT-Ext EditorGridPanel rendering problem <p>I am using GWT 1.6.4 and GWT-Ext 2.0.6. I am trying to use EditorGridPanel and facing rendering problems.</p>
<p>When the module loads I create a Panel (TopPanel) with BorderLayout and add that to the ViewPort. I then create another Panel (CenterPanel) and add EditorGridPan... | <p>I have found the solution. I had to add the Grid on a panel. I had to set the layout of that panel to FitLayout(). Secondly had to call doLayout() on that panel after loading the Store with the data. I now get the scrollbars for the table as well as it fits the whole available space.</p>
|
jQuery POST not changing IsPostback variable <p>When using jQuery to POST data back to the server, I'm getting some strange behavior.</p>
<p>If I include __VIEWSTATE and __EVENTVALIDATION in my serialized form data, the IsPostback page variable is set to true, If I exclude these two, the IsPostback is set to false.</p... | <p>One of the things the viewstate and eventvalidation track are whether or not a postback has occurred. Considering the event-based ASP.NET page lifecycle, there is no other way to track if a postback has occured than by simply storing the value somewhere.</p>
<p>In other words, you could manually check for postback... |
jQuery: set value of table cell inside div <p>I have a floating div which contains a title and I want to change that title. I tried this:</p>
<pre><code>$("div#dragTitle3").text("New Title");
</code></pre>
<p>But the title is actually in a table inside the div. This is the table:</p>
<pre><code><table><tbod... | <p>This should work:</p>
<pre><code>$("div#dragTitle3 td:first").text("New title")
</code></pre>
|
Transferring data between sqlite databases <p>I am developing an application in Django using sqlite on windows.Will this db work on a linux machine? If not, how do i replicate the data on the new db on linux (creating scripts is one way)?</p>
| <p>As Robert writes, SQLite files should work on any platform. If you decide to switch to MySQL or PostgreSql you can run the following (standard) command to save your database on the Windows machine:</p>
<pre><code>manage.py dumpdata <app1> <app1> > mydbdump.json
</code></pre>
<p>and then configure th... |
Sharing a DataTable across multiple forms in winforms <p>I'm trying to write a simple Compact Framework winforms app. The main form has a DataGrid bound to a DataTable (with data from an xml file). I want to bring up another form that displays the details of the current record. I have something like the following co... | <p>Databindings "bind" to a provided "View", currently you are binding to the DataTable without setting the default view (So it will default to the complete table). Eg. dtLandlords.DefaultView.RowFilter = "LandlordID = TheIdYouWant";</p>
<p>The other way to do it is to add the DataGrid/GridView itself to the DataBing... |
Create a dictionary on a list with grouping <p>I have the following object in a list:</p>
<pre><code>public class DemoClass
{
public int GroupKey { get; set; }
public string DemoString { get; set; }
public object SomeOtherProperty { get; set; }
}
</code></pre>
<p>Now, I want to create following dictionary... | <p>Just to make <a href="http://stackoverflow.com/questions/938040/what-linq-statement-to-create-a-dictionary-on-a-list-with-group/938069#938069">mquander's suggestion</a> concrete:</p>
<pre><code>var groupedDemoClasses = mySpecialVariableWhichIsAListOfDemoClass
.GroupBy(x => x.GroupKey... |
Java Memory model question <p>I know maybe the answer to the question is obvious. But if anybody can give me a definitive answer, that would be helpful.</p>
<p>The question is : whether the java NIO package can provide some memory consistency assurance?</p>
<p>The scenario is :</p>
<pre><code>Thread A ... | <p>My guess is that a TCP request does not make any formal guarantee as to thread synchronization.</p>
<p>That said, I think there is a simple solution to the issue you are raising: it is reasonable to assume that a TCP request is at least as expensive (perofrmance-wise) as acquiring a lock. Therefore, you can enclose... |
Tilde operator in Regular expressions <p>I want to know what's the meaning of tilde operator in regular expressions.</p>
<p>I have this statement:</p>
<pre><code>if (!preg_match('~^\d{10}$~', $_POST['isbn'])) {
$warnings[] = 'ISBN should be 10 digits';
}
</code></pre>
<p>I found this document explaining what til... | <p>In this case, it's just being used as a delimiter.</p>
<p>Generally, in PHP, the first and last characters of a regular expression are "delimiters" to mark the start and ending position of a matching portion (in case you want to add modifiers at the end, like ungreedy, etc)</p>
<p>Generally PHP works this out from... |
How to unobtrusively update the page title with JS (in Rails) <p>Whenever I load a blog post onto the page with Ajax, I set the page <code><title></code> to "My Blog - BLOGPOST_TITLE".</p>
<p>Of course "My Blog - " appears in my application layout as well.</p>
<p>The question is, how do I tell my Javascript abo... | <p>Before Ajax is sent to server store document.title value ("My Blog") to some variable.
Then when response arrives set document.title to document.title + ' - ' + BLOGPOST_TITLE</p>
<p>so you have in HTML:</p>
<p>...
< title>My Blog< /title>
...</p>
<p>and in JS:</p>
<pre>
var TITLE = document.title;
functi... |
Get current URL from IFRAME <p>Is there a simple way to get the current URL from an iframe?</p>
<p>The viewer would going through multiple sites.
I'm guessing I would be using something in javascript.</p>
| <p>For security reasons, you can only get the url for as long as the contents of the iframe, and the referencing javascript, are served from the same domain. As long as that is true, something like this will work:</p>
<pre><code>document.getElementById("iframe_id").contentWindow.location.href
</code></pre>
<p>If the ... |
Jquery Ajax animation? <p>I have a ajax jquery petition ... is there a standard way of displaying a nice animation while it completes.</p>
<p>Anybody have any info?</p>
<p>Its just that petition is taking around 15 seconds when there is an error in the server... so i would like to display an animation in case of this... | <p>you want this: <a href="http://www.ajaxload.info/">http://www.ajaxload.info/</a></p>
<p>use that to generate loading images that match the style of your page.</p>
<p>Edit:
The css/html would be like (note: not tested): </p>
<pre><code>.container {
position: relative;
height: 20ex;
width: 20em;
}
.hi... |
Matching order in PCRE <p>How can I set which order to match things in a PCRE regular expression?</p>
<p>I have a dynamic regular expression that a user can supply that is used to extract two values from a string and stores them in two strings. However, there are cases where the two values can be in the string in reve... | <p>you can extract the strings by name using</p>
<pre><code>(?<name>\w+)
</code></pre>
<p>and get the values with </p>
<pre><code>pcre_get_named_substring
</code></pre>
|
Comparing two matrices in Matlab <p>I have two matrices x and y, both are results from different algorithms/routines that are supposed to calculate the same result. While I know that the isequal() would check if x and y are the same matrix, the entries in those matrices would not be exactly the same (i.e. some entries ... | <p>Try this:</p>
<pre><code>tf = abs((A-B)./B)<0.05
</code></pre>
<p>This will return a logical matrix which will be true for each element if the relative difference between A and B with respect to B is less than 5 percent.</p>
<p>If you want to ask if all of these are true (they all satisfy the above condition):... |
is it possible to know where the user is coming from when he uses the back button? <p>For example,</p>
<p>if user goes to google -> example.com -> newwebsite.com</p>
<p>If he goes back to example.com, the http-referrer page will still be google.com</p>
<p>How can I detect that he went to newwebsite.com</p>
| <p>I believe that the back button will send the HTTP headers that were sent to the site the first time around, since it's not <em>really</em> a new visit.</p>
<p>Say you displayed an error page if the user's http-referrer was newwebsite.com. The first time they visited, they would get your site. If they went to newweb... |
how to make BindingNavigatorAddNewItem to ask primary key in a dialog? <p>how to make BindingNavigatorAddNewItem to ask primary key in a dialog while new row is created after button is clicked?</p>
<p>currently its adding blank row to end of DATAGRIDVIEW that is a big confusing for end user , if user forgets to enter... | <p>In most cases users should not be aware of primary keys. Instead of having to enter a primary key, let the database auto-generate one for you by setting the key as an identity column.</p>
<p>You tagged this asp.net but the question is a win-forms question.</p>
|
bash: How to delimit strings to find files <p>What syntax should I use in a bash script to list files based on 3 dynamic values:
- older than X days
- in a specified directory
- whose name contains a specified string?</p>
<pre><code>FILEAGE=7
FILEDIR='"/home/ecom/tmp"'
FILESTRING='"search-results-*"'
FILES_FOR_REMOVAL... | <p>Remove superfluous quotes:</p>
<pre><code>FILEAGE=7
FILEDIR='/home/ecom/tmp'
FILESTRING='search-results-*'
FILES_FOR_REMOVAL=$(/usr/bin/find "${FILEDIR}" -maxdepth 1 -type f -mtime +${FILEAGE} -name "${FILESTRING}" -exec ls -lth {} \;)
</code></pre>
|
how to add a new modulo position on a joomla template? <p>i'm using a joomla template called decayed and it doesn't have the right position, only the left one and nothing more.</p>
<p>i would like to add a right and a button positions on that template. how can i do it?</p>
<p>cheers</p>
| <p>Assuming you're using joomla 1.5, go into the template directory (/templates/someTemplateName/). I don't know anything about this theme, but if it follows the standard scheme for a joomla template, then modify these two files:</p>
<p>1) index.php</p>
<pre><code> <jdoc:include type="modules" name="myModulePos... |
C#: How to see if a Linq2SQL entity is in the database <p>I would like to check if an entity is already added to the database. So, how can I see this difference between <code>a</code> and <code>b</code>?</p>
<pre><code>var a = dataContext.Things.First(x => x.Name == something);
var b = new Thing { Name = something ... | <p>If you use <code>FirstOrDefault</code> instead of <code>First</code>, that will return <code>null</code> if there are no matches.</p>
<p>As for knowing whether you need to insert - just remember whether or not it was null to start with:</p>
<pre><code>var a = dataContext.Things.FirstOrDefault(x => x.Name == som... |
Transactions .NET <p>I've just begon using Transactions in .NET and I have a problem. In a function (in my DAL) I use a transaction scope. On the end of the function I trigger the Complete() function. </p>
<p>Now I have a test for this function which also uses a transaction scope. On the end of this test function I do... | <p>You need to understand <a href="http://www.pluralsight.com/community/blogs/jimjohn/archive/2005/06/18/11451.aspx" rel="nofollow">nested transaction scopes</a> and the <a href="http://msdn.microsoft.com/en-us/library/system.transactions.transactionscopeoption.aspx" rel="nofollow">TransactionScopeOption</a>.</p>
|
Showing the list view web part for a list in another site <p>I cannot show the content of a document library using a list view contained in a web part located on my root web application.</p>
<p>Here is the site structure:</p>
<pre>
main_site
subsite1
Shared Documents
subsite2
Shared Documents
... | <p>The problem is that the list is in another site.</p>
<p>It is possible to use the ListViewWebPart to reference a list from another site in the same site collection. You need to use the <a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.webpartpages.listviewwebpart.webid.aspx" rel="nofollow">WebId... |
Resizing dynamic stack allocations in C++ <p>I'm writing a small ray tracer using bounding volume hierarchies to accelerate ray tracing.
Long story short, I have a binary tree and I might need to visit multiple leafs.</p>
<p>Current I have a node with two children left and right, then during travel() if some condition... | <p>So, you've got a recursive function that you want to convert to a loop. You correctly work out that your function is not tail call so you have to implement it with a stack.</p>
<p>Now, why are you worried about the number of times that you allocate your "scratch space" stack? Is this not done once per traversal? --... |
Automated website folder backup system needed? Any recommendations? <p>Hi guys is there any backup software that can take periodic backups of online website folders and store them offline on a local system. Need something robust and would be nice if theres something free that can do the job :)</p>
<p><hr /></p>
<p>Th... | <p>If you are referring to a website that will be accessed by you from your browser (rather than as the administrator of the site) you should check out <a href="http://www.gnu.org/software/wget/" rel="nofollow">WGet</a>. And, if you need to use WGet from a Windows system, checkout <a href="http://www.cygwin.com" rel="n... |
How to check a popup menu item? <p>How to check a popup menu item?</p>
| <p>using <a href="http://msdn.microsoft.com/en-us/library/sbd652b3%28VS.80%29.aspx" rel="nofollow">CMenu::CheckMenuItem</a></p>
<p>See the example in <a href="http://msdn.microsoft.com/en-us/library/5z8dxz39%28VS.80%29.aspx" rel="nofollow">MSDN</a>.</p>
|
can we write a program to measure how much traffic any website has like Alexa does? <p>Can we write a program to measure how much traffic any website has like Alexa or ComScore does? Do we need to be in the middle of an internet backbone or have access to such traffic data? can we write any program to measure it just... | <p>If you want to measure traffic you need a way of counting the number of times a specific website is used by end users. </p>
<p>There are basically 5 places to do make measurements:</p>
<ol>
<li>Modify the website to retrieve 'something extra' and count that (i.e. the way omniture and the likes work).</li>
<li>Chan... |
jQuery Cross domain ajax calls and Internet Explorer <p>The following code works fine in Firefox but in IE the link is never called, the exception is called with a rather generic [Object Error]</p>
<pre><code>var GoalID = "e13e68a8-ae18-49f1-9d2f-e052a63fac51";
try
{
$.ajax({
type: "GET",
url: "http://... | <p>Cross domain Ajax calls are not allowed</p>
<p>Solution (not the best one)</p>
<pre><code>Prepare a local file (e.g. localfile.asp)
which initiates RPC to a remote server
</code></pre>
|
Read STDIN (SYSIN) in COBOL <p>I want to read the lines out of STDIN (aka SYSIN) in COBOL. For now I just want to print them out so that I know I've got them. From everything I'm reading it looks like this should work:</p>
<pre><code> IDENTIFICATION DIVISION.
PROGRAM-ID. APP.
ENVIRONMENT DIVISION.
INPUT-OUTPU... | <p>My COBOL dates back to the DPS-6 minicomputer runnong GCOS-6 and I lasted touched that in 1992. But back then we used ACCEPT to get input from stdin.</p>
|
How to I authenticate with a ISA proxy from my application seemlessly? <p>I am trying to us Qt to access a website and download updates, the problem is that one install base is using a Microsoft ISA proxy server which requires authentication.</p>
<p>Qt gives me a function to supply a username and password:
<a href="ht... | <p>What type of proxy are you running? See </p>
<p><a href="http://doc.qt.io/archives/4.6/qnetworkproxy.html" rel="nofollow">http://doc.qt.io/archives/4.6/qnetworkproxy.html</a></p>
<p>to find what proxies Qt support.</p>
|
How to verify that the mouse over an element? <p>Do you know how to check whether the mouse is over an element?</p>
<p>Somethnig like this?</p>
<pre><code>setTimeout(function() {
if($(this).mouseover()) { // this not work
return false;
} else {
$(this).hide();
}
}, 1000);
</code></pre>
<p>Tha... | <p>You could use something like this:</p>
<pre><code>var isMouseOver = false;
$(myitem).hover(function() {isMouseOver = true;},
function() {isMouseOver = false;});
</code></pre>
|
Python IRC bot and encoding issue <p>Currently I have a simple IRC bot written in python.</p>
<p>Since I migrated it to python 3.0 which differentiates between bytes and unicode strings I started having encoding issues. Specifically, with others not sending UTF-8.</p>
<p>Now, I could just tell everyone to send UTF-8 ... | <p><a href="https://pypi.python.org/pypi/chardet" rel="nofollow">chardet</a> should help - it's the canonical Python library for detecting unknown encodings.</p>
|
smime C# encrypted emails with attchments <p>I need to send encrypted emails using C# without using any third party component. This is pretty much working as long as I do not need attchments on the email but as soon as I add attchments, I face the same problem as described on <a href="http://social.msdn.microsoft.com/f... | <p>See the <a href="http://msdn.microsoft.com/en-us/library/system.net.mail.attachment.attachment.aspx" rel="nofollow">constructors</a> for the Attachment class. </p>
<p>If you pass in a Stream you can pretty much put anything in the attachment.</p>
|
Zend framework 1.8 recommended way to register a plugin? <p>In Zend Framework 1.8, what is the recommended way to register a new plugin in Zend Framework 1.8?</p>
<pre><code><?php
/**
* Enter description here...
*
*/
class Wenbert_Controller_Plugin_CheckHasAccess extends Zend_Controller_Plugin_Abstract {
/*... | <p>I'm assuming you mean the Zend_Application way of doing things. There's absolutely nothing wrong with the way you mentioned above. That said, you can specify which plugins to load in your application.ini, like so:</p>
<pre><code>resources.frontController.plugins.foo = "My_Plugin_Foo"
resources.frontController.plugi... |
WSE 3.0 set content type <p>I've a simple question, for you, that I just can't seem to get my head around.</p>
<p>The situation is the following:</p>
<ul>
<li>We create and send a request to a web service, using WSE 3.</li>
<li>The web service is written in Java.</li>
</ul>
<p>Most of the things are fine, but I can'... | <p>This has been solved luckily, so here's the solution for future reference:</p>
<p>Our client inherits from the WebServicesClientProtocol class, in which there's a method called GetWebResponse(..).
Simply overriding that method and changing the ContentType of the Response seemed to work out for us.</p>
<pre><code> ... |
When will C# AES algorithm be FIPS compliant? <p>Right now the only way I can get the <a href="http://msdn.microsoft.com/en-us/library/system.security.cryptography.rijndaelmanaged.aspx">RijndaelManaged</a> algorithm to work on a computer with the Local Security Setting for FIPS turned on, is to <a href="http://blog.agg... | <p>I never realized this before this question, but you're right. The constructor has this:</p>
<pre><code>public RijndaelManaged()
{
if (Utils.FipsAlgorithmPolicy == 1)
{
throw new InvalidOperationException(Environment.GetResourceString("Cryptography_NonCompliantFIPSAlgorithm"));
}
}
</code></pre>
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.