instruction
stringlengths
0
30k
Ok. This appears to work from most UI (all?) contexts provided the solution is loaded: Sub DebugTheServer() DTE.Windows.Item(Constants.vsWindowKindSolutionExplorer).Activate() DTE.ActiveWindow.Object.GetItem("Solution\ServerFolder\ServerProject").Select(vsUISelectionType.vsUISelectionTypeSele...
Something like: var divided = str.split("/~/"); var name=divided[0]; var street = divided[1]; Is probably going to be easiest
If you're using .net, there's the .net data provider for SQL server in PerfMon. You can look at NumberOfPooledConnections there
@jjrv<br> What you're describing is actually a linear congrential generator. The most random bits are the highest bits. To get a number from 0..N-1 you multiply the full value by N (32 bits by 32 bits giving 64 bits) and use the high 32 bits.<p> You shouldn't just use any number for <b>a</b> (the multiplier for prog...
If you're using SQL 2000, you can check in SQL 2000 Enterprise Manager: > To view the Current Activity window In > SQL Server Enterprise Manager, expand > a server group, and then expand a > server. Expand Management, and then > expand Current Activity. Click Process > Info. > > The current server activit...
You could run sp_who2 in SQL Server Management Studio or Query Analyser to see all of your curent connections. That is SQL Server. I'm not sure which RDBMS that you are using. Also, look in your code and make sure that you close a connection as soon as you don't need it anymore. Be anal about this!
I have a legacy C++ module that offers encryption/decryption using the openssl library (DES encryption). I'm trying to translate that code into java, and I don't want to rely on a DLL, JNI, etc... C++ code looks like: des_string_to_key(reinterpret_cast<const char *>(key1), &initkey); des_string_to_key(rein...
I always map `control + alt + f4` to documents.CloseAllWindows in options>environment>keyboard. Is somewhat more intuitive than using the mouse.
You should give [Ditto](http://ditto-cp.sourceforge.net/) a try. It saves everything you put in your clipboard into an sqlite database. A shortcut pops it up and shows the history of your clippings. The nice thing is that you can instantly search in this window through all your clippings. I set it up to remeber...
You should give [Ditto](http://ditto-cp.sourceforge.net/) a try. It saves everything you put in your clipboard into an sqlite database. A shortcut pops it up and shows the history of your clippings. The nice thing is that you can instantly search in this window through all your clippings. I set it up to remeber...
I love the speed of Vim but I find it lacks the features of a modern IDE for C++ development. Eclipse CDT with the [viPlugin][1] is a good compromise. You get the power and source overview provided by Eclipse CDT with the speed and flexibility of Vim for coding. [1]: http://satokar.com/viplugin/
Sure, the code you want to look at is in kbd-1.12.tar.bz2, which is the source bundle for the 'kbd' package. The 'kbd' package provides tools such as 'dumpkeys', 'showkeys' and 'loadkeys', which are useful for looking at the current keyboard mapping, checking what keys emit what scancodes, and loading a new mapping. ...
Not sure how you popup the context menu, but you can use HitTest() to get from a point to a tree item. So you might use this in your right click handler. Don't forget that the context menu can also be activated by a key on reasonable modern keyboards. Then you probably want to use the selected item as target.
One problem with the answer by Dave L. is when s2 contains regex markup such as \d etc. You want to call Pattern.quote() on s2: Pattern.compile(Pattern.quote(s2), Pattern.CASE_INSENSITIVE).matcher(s1).find();
I wrote a full program to do just this a while back. I can upload a demo later when I get home. Here is a the code (asp.net/c#): h[ttp://naspinski.net/post/Findingcounting-Keywords-out-of-a-Text-Document.aspx][1] [1]: http://naspinski.net/post/Findingcounting-Keywords-out-of-a-Text-Document.aspx
In fact, they may differ if debug mode uses the x87 FPU and release mode uses SSE for float-ops.
> It's important to me that the file type is determined by looking at the file's headers and not simply the extension. For that you can use 'file' unix command (orsome php function that implements the same functionality). `/tmp$ file stackoverflow-logo-250.png`<br> `stackoverflow-logo-250.png: PNG image data, ...
This behaviour is by design -- right-clicking doesn't move the selection. For what you want, turn on the TVS\_EDITLABELS style on the tree view. Then you handle the TVN\_BEGINLABELEDIT and TVN\_ENDLABELEDIT notifications.
It's simple - most users keep using the browser that came with the PC when they bought it (think of your mom). The browser is dead when the machines that it pre-installed with are not longer used for Internet access... which is probably around 5 years. As prices of new PC's drops and they become more of a consumer el...
I would recommend [C++Builder][1], from Embarcadero, for C++ work and there is also a [free version][2] available. If you prefer Visual Studio, download one of free [express editions][3]. [1]: http://www.codegear.com/products/cppbuilder [2]: http://www.turboexplorer.com/ [3]: http://www.microsoft.com/expr...
As others have mentioned, this isn't part of the standard and is left up to the compiler to implement as it sees fit for the processor in question. For example, VC could easily implement different alignment requirements for an ARM processor than it does for x86 processors. Microsoft VC implements what is basically ...
The best way to prevent XSS is not to try and filter everything, but rather to simply do HTML Entity encoding. For example, automatically turn &lt; into &amp;lt;. This is the ideal solution assuming you don't need to accept any html input (outside of forum/comment areas where it is used as markup, it should be pretty...
[System.IO.Path.Combine][1] [1]: http://msdn.microsoft.com/en-us/library/system.io.path.combine.aspx
It depends on the group dynamics and personal preferences. Personally, I have enjoyed my work groups that use chat to feed on each other's ideas and troubleshoot without as much walking around. If you are geography dispersed, its almost a necessity.
Look up something called WebServices, SOAP and XML-RPC. Should get you well on your way.
I'd use the [Process.Start method][1]. [1]: http://msdn.microsoft.com/en-us/library/53ezey2s.aspx "Process.Start Method (String)" Process.Start("http://www.google.com/");
I Need to manually migrate modified stored procedures from a DEV SQL Server 2005 database instance to a TEST instance. Except for the changes I'm migrating, the databases have the same schemas. How can I quickly identify which stored procedures have been modified in the DEV database for migration to the TEST instance...
Just set the field as an [identity field](http://msdn.microsoft.com/en-us/library/aa933196.aspx).
The [Eclipse TPTP][1] can be incredibly useful for finding the slow spots in code and for anything else that would requiring debugging, profiling, or benchmarking. The only flaw is that it doesn't work on the mac :'(. [1]: http://www.eclipse.org/tptp/
After you exhaust all the options mentioned above, I would look into row and table locks. If this is the case it should return an error saying it encountered a lock. Are you running an application that could be swallowing errors?
Like this create table foo ( user_id int not null identity, name varchar(50) )
declare the field to be identity
There's no argument against the ability to re-send it, is there? Assuming that re-sending it will end up with the same action doesn't count - there's no harm to re-sending it. If there's an argument for it, and none against it, that should be an easy decision.
The Chrome answer is more about failure mitigation and not about code quality. Doing what Chrome is doing is admitting defeat. 1. Better QA that is more than just programmer testing their own work. 2. Unit testing 3. Regression testing 4. Read up on best practices that other companies use. To be blun...
The Chrome answer is more about failure mitigation and not about code quality. Doing what Chrome is doing is admitting defeat. 1. Better QA that is more than just programmer testing their own work. 2. Unit testing 3. Regression testing 4. Read up on best practices that other companies use. To be blun...
**SmartInspect** is really useful. It is the only one I have used. The logging library is good, but the console and the remote TCP/IP logging takes it over the top. I think CodeSite has some similar features.
This is also MySQL Specific: show fields from [tablename]; this doesnt just show the table names but it also pulls out all the info about the fields.
According to the technical article on MSDN titled **Understanding XML Schema** at [http://msdn.microsoft.com/en-us/library/aa468557.aspx#understandxsd_topic5][1] you can take advantage of constraints such as *minOccurs* on the choice definition (compositor) itself: *"Using occurrence constraints on a compositor ap...
`const` is about program semantics and not about implementation details. You should mark a member function `const` when it does not change the visible state of the object, and should be callable on an object that is itself `const`. Within a `const` member function on a class `X`, the type of `this` is `X const *`: poin...
Best resources for converting C/C++ dll headers to Delphi?
Here is a sample User Defined Function (UDF) and possible usage. Function: Function Coalsce(strSQL As String, strDelim, ParamArray NameList() As Variant) Dim db As Database Dim rs As DAO.Recordset Dim strList As String Set db = CurrentDb If strSQL <> "" Then ...
I find online chatting invaluable in many cases, but not normally instant messaging. Since I use many open source technologies at work, I tend to join the respective IRC channels, both to ask questions there, and sometimes to help others if I know the answer offhand.
Oft overlooked modules, uses and tricks: collections.defaultdict(): for when you want missing keys in a dict to have a default value. functools.wraps(): for writing decorators that play nicely with introspection. posixpath: the os.path module for POSIX systems. You can use it for manipulating POSIX paths (incl...
private void launchURL_Click(object sender, System.EventArgs e){ string targetURL = "http://stackoverflow.com"; System.Diagnostics.Process.Start(targetURL); }
You may also want to look at [V8][1] from Google. It's pretty new, though. [1]: http://code.google.com/p/v8/
If you're on a Unix machine try this: mimetype = `file -ib #{path}`.gsub(/\n/,"") I'm not aware of any pure Ruby solutions that work as reliably as 'file'.
If you're on a Unix machine try this: mimetype = `file -Ib #{path}`.gsub(/\n/,"") I'm not aware of any pure Ruby solutions that work as reliably as 'file'.
If you're on a Unix machine try this: mimetype = `file -Ib #{path}`.gsub(/\n/,"") I'm not aware of any pure Ruby solutions that work as reliably as 'file'. Edited to add: depending what OS you are running you may need to use 'i' instead of 'I' to get file to return a mime-type.
By far the easiest way that I have found to do 3 columns (or any other number of columns split over the available space in weird ways) is [YUI Grids][1]. There is a [YUI Grids Builder][2] to give you the basic layout. The following will give you a 750px wide basic 3 column layout (split 1/3 1/3 1/3) with a 160px left s...
I explained about the mouse hooking, and mentioned it could be difficult to locate your exact icon. I did found the following article about how to locate a tray icon. [CTrayIconPosition - where is my tray icon?][1] by Irek Zielinski. I think if you try to understand how it works you can turn it around and use it to ...
Since Java 5 you have the getStackTrace() method of Thread class. For prior versions you can do: Thread.currentThread().dumpStack(); This will print the stack trace to System.out
Since 1.5 you can use `Thread.getAllStackTraces()` to get a `Map` to iterate over. The ideal output would be that produced from Ctrl-\ (or Ctrl-Break or similar), but there doesn't seem to be a documented way of producing this. If you are willing to limit yourself to sun's JVM (or use reflection I suppose) you could...
|macos|cocoa|sfauthorizationpluginview|
Update: Its the new wave.. which suggest everything that we've been doing till now is passe.. Seems to be propping up quite a bit in podcasts and books.. Maybe this is what you heard. Till now we've been concerned with static classes and not **unleased** the power of object oriented development. We've been doing 'cl...
Where your statics go depends on if they are 0 initialized or not. 0 initialized static data goes in [.BSS (Block Started by Symbol)][1], non 0 initialized data goes in [.DATA][2] [1]: http://en.wikipedia.org/wiki/.bss [2]: http://en.wikipedia.org/wiki/Data_segment
The culture for a thread in .NET is the culture for the system. There is no way to override that in .NET, you'll have to continue setting the CurrentCulture for each new thread.
Instead of explicitly rearranging bytes, the correct way is to rely on built-in functions for converting from host to network order (htons and the likes) -- this way your code will continue working just fine even when run on a big-endian machine. In general, when troubleshooting such issues, I find it useful to reco...
|c++|c|delphi|dll|header|
A rather comprehensive site explaining the difficulties and solutions involved in using a dll written in c/c++ and the conversion of the .h header file to delphi/pascal was posted to a mailing list I was on recently, so I thought I'd share it, and invite others to post other useful resources for this, whether they be l...
You have two options. 1. Convert your user session (when the user accesses your app manually) to infinite session, then periodically update the profile information for a user. There is some information on how to do this (and what API calls you can make without sessions) [here][1]. 2. Create a new "handle" (see [...
You need two tables. One for storing the repeating events (table repeatevent) and one for storing the events (table event). Simple entries are only stored in the event table. Repeating entries are stored in the repeatevent table and all single entries for the repeating event are also stored in the event table. This mea...
You need two tables. One for storing the repeating events (table repeatevent) and one for storing the events (table event). Simple entries are only stored in the event table. Repeating entries are stored in the repeatevent table and all single entries for the repeating event are also stored in the event table. This mea...
- 'client server' or 'peer to peer' or something in between: which computer has authority over which game actions. With turn based games, normally it's very easy to just say 'the server has ultimate authority and we're done'. With real time games, often that design is a great place to start, but as soon as you ...
If you want a human-readable result, you can also use this type of file : ofaurax|27|male|something| another|24|unknown|| ... This way, you have only one file, you can debug it (and manually fix) easily, you can add fields later (at the end of each line) and the PHP code is simple (for each line, sp...
Are you using the Axis2 API to generate the call? If so it might go something like this: SOAPFactory fac = OMAbstractFactory.getSOAP11Factory(); SOAPEnvelope envelope = fac.getDefaultEnvelope(); OMNamespace xsi = fac.createOMNamespace("http://www.w3.org/2001/XMLSchema-instance", "xsi"); enve...
###Using WSDL2Java If you have used the Axis2 WSDL2Java tool you're kind of stuck with what it generates for you. However you can try to change the skeleton in this section: // create SOAP envelope with that payload org.apache.axiom.soap.SOAPEnvelope env = null; env = toEnvelope( ...
Another way, if desired, is to have the 'print' button on the page change the page in some way that you decide, then perform a javascript 'window.print();' to bring up the browser's print dialog.
1. Set Content-Type: Response.ContentType = "application/pdf" 2. Set ContentDisposition, if you want to give a new name for the file: Response.Headers.Add("Content-Disposition", "attachement: filename=file.pdf"); 3. Write the content, using Response.OutputStream as Mr. Kopp said. Step 2 is not strictly necessary, ...
The easiest way is to use CSS media types. For each CSS file you include, you can specify where it ought to be used: on-screen, when printing, for handhelds, for screen-readers, or various combinations of these. Example: *&lt;link rel="stylesheet" type="text/css" media="print, handheld" href="foo.css"&gt;* Thi...
Instead of explicitly rearranging bytes, the correct way is to rely on built-in functions for converting from host to network order (htons and the likes) -- this way your code will continue working just fine even when run on a big-endian machine. In general, when troubleshooting such issues, I find it useful to reco...
As everyone here has already pointed out, the issue is most likely caused by the C# application sending ints in little-endian order whereas the Java app expects them in network order (big-endian). However, instead of explicitly rearranging bytes in the C# app, the correct way is to rely on built-in functions for conver...
I'm a very satisfied user of ACL http://agilewebdevelopment.com/plugins/acl_system do try it!
There are existing web services for this. Two examples: - [Yahoo's Term Extraction API][1] - [Topicalizer][2] [1]: http://developer.yahoo.com/search/content/V1/termExtraction.html [2]: http://topicalizer.com/api
There are existing web services for this. <s>Two</s> Three examples: - [Yahoo's Term Extraction API][1] - [Topicalizer][2] - [OpenCalais][3] [1]: http://developer.yahoo.com/search/content/V1/termExtraction.html [2]: http://topicalizer.com/api [3]: http://www.opencalais.com/
How do you query object collections in Java (Criteria/SQL-like)?
|java|sql|collections|
Suppose you have a collection of a few hundred in-memory objects and you need to query this List to return objects matching some SQL or Criteria like query. For example, you might have a List of Car objects and you want to return all cars made during the 1960s, with a license plate that starts with AZ, ordered by the n...
I think URLConnection.setReadTimeout is what you are looking for.
Simple, free PHP blog engine easy to redesign?
|php|blog-engine|
I am looking for a PHP blog engine which needs to be easy to redesign (CSS, HTML). It also needs to be free and have simple user interface so that the client doesn't struggle to add posts. Any suggestions?
Convert C# 2.0 System.Data.SqlTypes.SqlXml object into a System.Xml.XmlNode
|c#|sqlxml|xmlnode|sqldatareader|
I seem to always have problems with converting data to and from XML in C#. It always wants you to create a full XMLDocument object even when you think you shouldn't have to. In this case I have a SQLXML column in a MS SQL 2005 server that I am trying to pull out and push into a function that requires an XMLNode as a pa...
Here's an article about finding the install path for Office Apps: http://support.microsoft.com/kb/234788
[Wordpress](http://www.wordpress.org) - I keep trying other blogs and I keep going back to wordpress. It's definitely the easiest I've used for customizing templates, and the admin UI is very nice.
Fastest way to determine image resolution and file type in PHP?
|php|jpeg|png|image|imagemagick|
I'm currently using ImageMagick to determine the resolution of images uploaded to the website. By calling ImageMagick's "identify" on the command line it takes about 0.42 seconds to determine a 1MB JPEG's resolution along with the fact that it's a JPEG. I find that a bit slow. Using the Imagick PHP library is even s...
Fastest way to determine image resolution and file type in PHP or Unix command line?
|php|image|png|jpeg|imagemagick|
Well, it's hard not to suggest Wordpress. Redesigning it isn't too terribly difficult, a monkey could use it, the admin interface is simple and easy on the eyes, and it has great community support. I'd recommend using the Automatic Upgrade plugin with it as well, so that your customer can always stay up to date as well...
[Article][1] at Rudy's Delphi Corner [1]: http://rvelthuis.de/articles/articles-convert.html#main
You can install Opera Mini on an emulator like the Java WTK and test mobile rendering on a PC. One drawback is that Opera Mini still works through a proxy, so debugging local files/sites won't work - you have to upload your site to a world-accessible server. Just google it.
You can drag code to the ToolBox. Try it!
I used [Magnolia][1] and found it very clean and customizable. [1]: http://www.magnolia.info/home.html
Shift+Alt+F10 brings up the built in refactoring menu. Great for adding method stubs from interfaces, and adding Using statements automatically for specific classes.
No it's not possible. Method should have same signature that one declared in interface. However you can use type parameter constrains: interface IDBClass<T> where T:IDbCommand { void Test(T cmd); } class DBClass:IDBClass<SqlCommand> { public void Test(SqlCommand cmd) ...
No it's not possible. Method should have same signature that one declared in the interface. However you can use type parameter constraints: interface IDBClass<T> where T:IDbCommand { void Test(T cmd); } class DBClass:IDBClass<SqlCommand> { public void Test(SqlCommand cm...
MySQL 3 and 4: desc tablename MSSQL (2005) and MySQL 5: select COLUMN_NAME from INFORMATION_SCHEMA.COLUMNS where TABLE_NAME = 'tablename'