instruction
stringlengths
0
30k
In the console, press V rather than T: t: dump thread list v: dump thread stack This works under JDK6. Don't know about others. Alternative, under JDK5 (and possibly earlier) you can send a full stack trace of all threads to standard out: *Under Windows:* type ctrl-break in the Java console. ...
When using stored procedures with MySQL, you will often need to use the [mysqli][1] interface in PHP and not the regular [mysql][2] interface. The reason for this is due to the fact that the stored procedures often will return more than 1 result set. If it does, the mysql API can not handle it and will you get err...
Try something like this: Node originalNode = cursor.getDomNode(); Node importNode = document.importNode(originalNode); Node fooNode = document.createElement("someOtherInsertedElement"); fooNode.appendChild(importNode); document.appendChild(fooNode);
Try something like this: Node originalNode = cursor.getDomNode(); Node importNode = document.importNode(originalNode); Node otherNode = document.createElement("someOtherInsertedElement"); otherNode.appendChild(importNode); document.appendChild(otherNode); So in other words: 1. Get the ...
Try something like this: Node originalNode = cursor.getDomNode(); Node importNode = document.importNode(originalNode.getFirstChild()); Node otherNode = document.createElement("someOtherInsertedElement"); otherNode.appendChild(importNode); document.appendChild(otherNode); So in other words:...
The first solution that jumps to mind is to do this in a frameset. Hide one of the frames, and the other display the pages in question. Drive the page transitions with Javascript from the hidden frame. function RefreshFrame() { parent.VisibleFrame.location.href = urlArray[i]; i++; ...
@Brad: Your answer isn't complete; he's most likely doing it too late in the page lifecycle, during the Page_Load event. Okay, here's what you're missing. ASP.NET is stateless. That means, after your page is rendered and sent to the browser, the page object and everything on it is destroyed. There is no link t...
@Brad: Your answer isn't complete; he's most likely doing it too late in the page lifecycle, during the Page_Load event. Okay, here's what you're missing. ASP.NET is stateless. That means, after your page is rendered and sent to the browser, the page object and everything on it is destroyed. There is no link t...
Well that depends what your migration looks like, what your database.yml looks like and what exactly you are trying to attempt. Anyway more information is needed change the names if you have to and post an example database.yml and the migration. does the migration change the search_path for the adapter for example ? ...
SharperCV was our tool of choice, and it doesn't let us down, for our [robotics project][1]. Even though it is currently marked as abandoned, the code is in really good shape, requires only minor tweaking to customize it for your need. No msgboxes, and actually very sane exception handling. Not cross-platform, thoug...
look here http://pastebin.me/48d233d998b4b basically its $('div').attr('custom:attr')
At the end of settings.py i have the following: try: from settings_local import * except ImportError: pass This way if i want to override default settings i need to just put settings_local.py right next to settings.py
You can't. What you can do is create a mapping between Types and a delegate using a dictionary: var TypeMapping = new Dictionary<Type, Action<string>>(){ {typeof(string), (x)=>Console.WriteLine("string")}, {typeof(bool), (x)=>Console.WriteLine("bool")} }; string s = "my string";...
Typecasting using "as" is of course much faster when the cast fails, as it avoids the expense of throwing an exception. But it is not faster when the cast succeeds. The graph at http://www.codeproject.com/KB/cs/csharpcasts.aspx is misleading because it doesn't explain what it's measuring. The bottom line is: - ...
Try the book "Windows Internals" by Mark Russinovich and I think some other guy too. It's pretty good on getting down to the nitty gritty.
**Layout flexibility** Imagine you're making a page with a large number of thumbnails. **DIVs**: If you put each thumbnail in a DIV, floated left, maybe 10 of them fit on a row. Make the window narrower, and BAM - it's 6 on a row, or 2, or however many fit. **TABLE:** You have to explicitly say how man...
Oracle 10 solution is SELECT * FROM PEOPLE WHERE SURNAME=q'{O'Keefe}'
At my work, we mostly do line of business apps - contract work. For this type of business, I'm a huge fan of ORM. About four years ago (when the ORM tools were less mature) we studied up on CSLA and rolled our own simplified ORM tool that we use in most of our applications,including some enterprise-class systems th...
Using Component Object Model (COM) on non-Microsoft platforms
|c++|com|cygwin|wine|mingw|
I'm regularly running into similar situations : I have a bunch of COM .DLLs (no IDL files) which I need to use and invoke to be able to access some foreign (non-open, non-documented) data format. Microsoft's Visual Studio platform has very nice capabilities to import such COM DLLs and use them in my project (Visual...
Typecasting using "as" is of course much faster when the cast fails, as it avoids the expense of throwing an exception. But it is not faster when the cast succeeds. The graph at http://www.codeproject.com/KB/cs/csharpcasts.aspx is misleading because it doesn't explain what it's measuring. The bottom line is: ...
I recently had to do something similar and using switch wasn't an option. Doing an == on the typeof(x) is fine, but a more elegant way might be to do something like this: if(property.PropertyType is bool){ //dostuff; } else if (property.PropertyType is string){ //do other stuff; } ...
I think what you are looking for here is a good Map. Using delegates and a Generic IDictionary<Type, MyDelegate> you can do what you want. Try something like this: private delegate object MyDelegate(); private IDictionary<Type, MyDelegate> functionMap = new IDictionary<Type, MyDelegate>(); ...
SCRUM - non cooperative team members
|scrum|
What do you do if members of your team are not cooperative during scrum meetings? They either provide a very high level definition of what they are curently working on, ("working on feature x"), or go into extremely non relevant details. This causes the scrum meeting to be ineffective and boring. As a scrum master...
What do you do if members of your team are not cooperative during scrum meetings? They either provide a very high level definition of what they are curently working on, ("working on feature x"), or go into extremely non relevant details. This causes the scrum meeting to be ineffective and boring. As a scrum master...
What do you do if members of your team are not cooperative during scrum meetings? They either provide a very high level definition of what they are currently working on, ("working on feature x"), or go into extremely irrelevant details. This causes the scrum meeting to be ineffective and boring. As a scrum master,...
What is the nature of the question here? Are you trying to see packets on port 8787? Are you looking for services listening on port 8787? Most importantly, how is this a programming-related question?
You'll normally only get mouse/keyboard events to a window or control when it has focus. If you want to see them without focus then you're going to have to put in place a lower-level hook. [Here is an example low level mouse hook][1] [1]: http://blogs.msdn.com/toub/archive/2006/05/03/589468.aspx
I've found that creating individual tables is the best idea. I've been down the road of trying to create one master table of all pick lists and then filtering out based on type. While it works, it has invariably created headaches down the line. For example you may find that something you presumed to be a simple pi...
See the implementation. It basically stores an int: transient volatile int modCount; and that is incremented when there is a 'structural modification' (like remove). If iterator detects that modCount changed it throws Concurrent modification exception. Synchronizing (via Collections.synchronizedXXX) won't...
See the implementation. It basically stores an int: transient volatile int modCount; and that is incremented when there is a 'structural modification' (like remove). If iterator detects that modCount changed it throws Concurrent modification exception. Synchronizing (via Collections.synchronizedXXX) won't...
How does gcc implement stack unrolling for C++ exceptions on linux?
|c++|exception|gcc|
How does gcc implement stack unrolling for C++ exceptions on linux? In particular, how does it know which destructors to call when unrolling a frame (i.e., what kind of information is stored and where is it stored)?
representing CRLF using Hex in C#
|c#|
How do i represent CRLF using Hex in C#?
I would recommend looking at the availability of [SMDR][1] (Station Messaging Detail Recording) on the PBX platforms you are targeting, assuming that no call/device control is required. Most likely the format between the PBX vendors will be different but hopefully this could be abstracted away so that the core applicat...
What do you do if members of your team are not cooperative during scrum meetings? They either provide a very high level definition of what they are currently working on, ("working on feature x"), or go into extremely irrelevant details, **in spite of being well educated in SCRUM methodology**. This causes the scrum m...
OK, to address the two parts of the problem. 1. the following code shows how to get at the pixels inside of a bitmap, change them and put them back into the bitmap. You could always generate a dummy bitmap of the correct size and format, open it up, copy over your data and you then have a bitmap object with your ...
OK, to address the two parts of the problem. 1. the following code shows how to get at the pixels inside of a bitmap, change them and put them back into the bitmap. You could always generate a dummy bitmap of the correct size and format, open it up, copy over your data and you then have a bitmap object with your ...
Idiomatic means following the conventions of the language. You want to find the easiest and most common ways of accomplishing a task rather than porting your knowledge from a different language. non-idiomatic python using a loop with append: mylist = [1, 2, 3, 4] newlist = [] for i in mylist: ...
Multi-core programming may actually require more than one paradigm. Some current contenders are: 1. [MapReduce][1]. This works well where a problem can be easily decomposed into parallel chunks. 2. [Nested Data Parallelism][2]. This is similar to MapReduce, but actually supports recursive decomposition of a probl...
Autmatically checking for a new version of my application
|c++|qt|
Trying to honor a feature request from our customers, I'd like that my application, when Internet is available, check on our website if a new version is available. The problem is that I have no idea about what have to done on the server side. I can imagine that my application (developped in C++ using Qt) has to s...
Trying to honor a feature request from our customers, I'd like that my application, when Internet is available, check on our website if a new version is available. The problem is that I have no idea about what have to be done on the server side. I can imagine that my application (developped in C++ using Qt) has t...
[Jason's DotNet Architecture Blog][1] has a tutorial that gets you started with the basics, using the MS SQL Server [AdventureWorks][2] sample database. [1]: http://dotnet-architecture-jdo.blogspot.com/2008/08/adonet-entity-framework-part.html [2]: http://www.codeplex.com/MSFTDBProdSamples
Microsoft offers [.NET 3.5 Enhancements Training Kit][1] it contains documentation and sample code for ADO.NET EF [1]: http://www.microsoft.com/downloads/details.aspx?FamilyID=355c80e9-fde0-4812-98b5-8a03f5874e96&displaylang=en
ADO.NET Entity Framework tutorials
|ado.net|entity-framework|tutorials|resources|
Does anyone know of any good tutorials on ADO.NET Entity Framework? There are a few useful links here at [Stack OverFlow][1], and I've found one tutorial at [Jason's DotNet Architecture Blog][2], but can anyone recommend any other good tutorials? Any tutorials available from Microsoft, either online or as part of ...
|tutorials|ado.net|entity-framework|
Sqlite is scalable in terms of single-user, I have multi-gigabyte database that performs very well and I haven't had much problems with it. But it *is* single-user, so it depends on what kind of scaling you're talking about.
If you are overriding the events, are you **calling the default implementation?** If you are overriding them to confirm their execution, then the actual code will not be getting executed either, which may be the break in the plumbing..
- [PODCAST: DSL Related Discussions in SE-Radio][1] [1]: http://www.se-radio.net/tags/dsls
Try this link you may get some best ideas... http://msdn.microsoft.com/en-us/library/aa697427(VS.80).aspx http://en.wikipedia.org/wiki/ADO.NET_Entity_Framework This one is nice try this.... http://davidhayden.com/blog/dave/archive/2007/03/19/ADONETEntityFrameworkObjectServicesTutorial.aspx http://www.c...
First of all you should be absolutely sure you need to iterate through each row - set based operations will perform faster in every case I can think of and will normally use simpler code. Depending on your data it may be possible to loop just using select statements as shown below: Declare @Id int ...
I'm not sure I understand what you're asking exactly, but, rake will be expecting to update the version of the Rails schema into the schema_info table. Check your database.yml config file, this is where rake will be looking to find the table to update. Is it a possibility that you are migrating to a new Postgres sc...
I'm not sure I understand what you're asking exactly, but, rake will be expecting to update the version of the Rails schema into the schema_info table. Check your database.yml config file, this is where rake will be looking to find the table to update. Is it a possibility that you are migrating to a new Postgres sc...
If you're on Windows x64, it may be an [installer problem][1]. It bit me on Server 20080 x64. [1]: http://blog.davebouwman.net/CommentView,guid,ccc158a2-d4fd-4765-9251-92be838f1ed8.aspx
Supportingly to VS you could use [WireShark][1] to see what the ODCB driver is sending to the DB. [1]: http://www.wireshark.org/
Yes it does, all the views are still there, just the inactive ones are hidden/disabled. [http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.multiview_properties.aspx][1] [1]: http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.multiview_properties.aspx
Making WCF easier to configure
|wcf|.net|configuration|
I have a set of WCF web services connected to dynamically by a desktop application. My problem is the really detailed config settings that WCF requires to work. Getting SSL to work involves custom settings. Getting MTOM or anything else to work requires more. You want compression? Here we go again... WCF is reall...
Automatically checking for a new version of my application
You can add a random (or sequential) number to the url that you change with every update.
If you want the data in the second array you should change the $_GET in for each to $_GET[0] foreach ($_GET[0] as $field => $label) { $datarray[]=$_GET[$field]; echo "$_GET[$field]"; echo "<br>"; } print_r($datarray);
Use `<pre>` tags before `print_r`, then you will have a tree printed (or just look at the source. From this point you will have a clear understanding of how your array is and will be able to pull the value you want. I suggest further reading on [`$_GET`][1] variable and [arrays][2], for a better understanding of its...
Does an IIS worker process clear session variables when it recycles?
|iis|session-variables|worker-process|
We're writing an asp.net web app on IIS 6 and are planning on storing our user login variables in a session. Will this be removed when the worker process recycles?
You'll probably want to at least store attachments separately to optimize storage. It's astonishing to see the size and quantity of attachments (videos, etc.) that most users unhesitatingly attach to emails. In the case of outgoing emails you may have multiple emails sending the same attachment. It's far more effi...
Here is a quick article on [Windows Memory Management][1], which goes into sufficient depth to interpret what you're actually seeing in Task Manager or [Process Explorer][2]. [1]: http://shsc.info/WindowsMemoryManagement [2]: http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx
Use "Pragma: no-cache" header in HTTP response. <http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9>
calling thread.start() within its own constructor
|java|multithreading|
is it legal for a thread to call this.start() inside its own constructor? and if so what potential issues can this cause? I understand that the object wont have fully initialized until the constructor has run to completion but aside from this are there any other issues?
Is there any tool which can generate a report for a valid C program
|c|parsing|report|
is there any tool that can parse a valid C program and generate a report which contains list of functions, global variables, #define constants, local variables in each function etc.
The type of a template function is inferred automatically, in contrast with that of a template class. You can use it even simpler: template< typename T > size_t structsize( const T& t ) { return sizeof( t ) / sizeof( *t ); } int ints[] = { 1,2,3 }; assert( structsize( ints ) == 3...
Inline displayed blocks form a single word in IE
|css|html|
The problem is that I have several "h2" tags that have a display:inline attribute, and on Microsoft's wonderful browsers the space between them doesn't appear. Is there a workaround? I know there is a "non-breaking space" &nbsp; in HTML but I was wondering if one can make a space that may be a "breaking space".
|html|css|internet-explorer|
The problem is that I have several "h2" tags that have a display:inline attribute, and on Microsoft's wonderful browsers the space between them doesn't appear. Is there a workaround? I know there is a "non-breaking space" &nbsp; in HTML but I was wondering if one can make a space that may be a "breaking space". -...
It depends on the Exception: if this actually should not happen, I definitely would log it. On the other way: if you expect this Exception you should think about the design of the application. Either way: you should at least try to specify the Exception you want to rethrow, catch or log. public foo(..) {...
you might want to have a look at plinq [http://msdn.microsoft.com/en-us/magazine/cc163329.aspx][1] [1]: http://msdn.microsoft.com/en-us/magazine/cc163329.aspx
You want to [Include Resources at Compile Time][1] (MSDN). [1]: http://msdn.microsoft.com/en-us/library/6e7446zd(VS.80).aspx
Do spend some time with the [Library Reference][1]. > The advantage of the xrange type is that an xrange object will always > take the same amount of memory, no matter the size of the range it represents. > There are no consistent performance advantages. [1]: http://docs.python.org/lib/typesseq-xrange.html
Do spend some time with the [Library Reference][1]. The more familiar you are with it, the faster you can find answers to questions like this. Especially important are the first few chapters about builtin objects and types. > The advantage of the xrange type is that an xrange object will always > take the same amo...
|.net|wcf|configuration|
I have a set of WCF web services connected to dynamically by a desktop application. My problem is the really detailed config settings that WCF requires to work. Getting SSL to work involves custom settings. Getting MTOM or anything else to work requires more. You want compression? Here we go again... WCF is reall...
JBoss 4.23 and EJB 2 support
|jboss|