instruction
stringlengths
0
30k
Also see the Mediawiki related CPAN modules - these are designed to hit Mediawiki sites (of which wikipedia is one) and might give you more bells and whistles than simple LWP. http://cpan.uwinnipeg.ca/search?query=Mediawiki&mode=dist
This will get you halfway there: http://www.codeproject.com/KB/dotnet/embedmultipleiconsdotnet.aspx Then you need to find the Win32 call which will set the displayed icon from the list of embedded icons.
The [Eclipse][1] IDE is capable of working with C/C++ in addition to Java. There is a [write-up][2] on how to configure Eclipse for C/C++ development on IBM's Developer Works site. [1]: http://www.eclipse.org/ [2]: http://www.ibm.com/developerworks/opensource/library/os-eclipse-stlcdt/index.html
The [Eclipse][1] IDE is capable of working with C/C++ in addition to Java. There is a [write-up][2] on how to configure Eclipse for C/C++ development on IBM's Developer Works site. [1]: http://www.eclipse.org/ [2]: http://www.ibm.com/developerworks/opensource/library/os-eclipse-stlcdt/index.html *edit:* Wh...
Get path geometry from FlowDocument object
|c#|wpf|
Can someone tell me how to get path geometry from a WPF FlowDocument object? Please not that I do **not** want to use `FormattedText`. Thanks.
I typically work in both blend and Visual Studio (2005) side by side when doing WPF development. (Although, granted, I typically do both design and c# coding). The benefits of using Blend is that certain tasks are extremely fast there - things like picking colors/brushes, creating animations and layout fixes such a...
I use [QuickMacros][1] and love it. so much so, that I did some extensive training articles on it [here][2]. [1]: http://www.quickmacros.com [2]: http://www.TheMacroHook.blogspot.com
public static void WriteLine(this List<int> theList) { foreach (int i in list) { Console.Write("{0}\t", t.ToString()); } Console.WriteLine(); } Then, later... list.WriteLine();
There can be a huge performance gain by limiting what columns are returned if the records are traversing the internet.
Handling empty values with ADO.NET and AddWithValue()
|sql|ado.net|vb.net|
I have a control that, upon postback, saves form results back to the database. It populates the values to be saved by iterating through the querystring. So, for the following SQL statement (vastly simplified for the sake of discussion)... UPDATE MyTable SET MyVal1 = @val1, MyVal2 = @val2 WHERE...
|sql|vb.net|ado.net|
I have a control that, upon postback, saves form results back to the database. It populates the values to be saved by iterating through the querystring. So, for the following SQL statement (vastly simplified for the sake of discussion)... UPDATE MyTable SET MyVal1 = @val1, MyVal2 = @val2 WHERE...
Another vote for Eclipse. In particular, you should be able to install it from within Ubuntu, as there are packages for it in one of the repositories (I forget which one specifically, as I'm not at my Ubuntu machine right this minute). If you use the GUI package-management application under the "Admin" menu, you should...
Some things that may break your model. These may not be a problem, but you should check with your client to see if they may occur. - Less than 1 day stays (short midday stays are common at some business hotels, for example) - Late check-outs/early check-ins. If you are just measuring the nights, and not dates/time...
If you've storing state objects by key, how about [Berkeley DB][1]. [1]: http://en.wikipedia.org/wiki/Berkeley_DB
Well, this may be a bit off topic, but if you are an Emacs user, I would say "emacs" is the most powerful trick... before you downvote this, try out "M-x shell" within an emacs instance... you get a shell inside emacs, and have all the power of emacs along with the power of a shell (there are some limitations, such as...
I usually just use vim, but i've actually found the IDE Geany quite intuitive with a lot of good features but not really overblown. Check it out. EDIT: I don't think Geany is fit for enterprise-level programming, but for a quick program it's one of the better IDEs I've seen, especially if you've had bad experiences ...
You can use the watch command in conjunction with another command to look for changes. An example of this was when I was testing my router, and I wanted to get up-to-date numbers on stuff like signal-to-noise ratio, etc. watch --interval=10 lynx -dump http://dslrouter/stats.html
If you decide to go with HApps you'll probably want to checkout this excellent example driven tutorial that is being developed as a HApps application: [HApps Tutorial][1] [1]: http://happstutorial.com:5001/
More of a novelty, but its clever... Top 10 commands used $ history | awk '{print $2}' | awk 'BEGIN {FS="|"}{print $1}' | sort | uniq -c | sort -n | tail | sort -nr 242 git 83 rake 43 cd 33 ss 24 ls 15 rsg 11 cap 10 dig 9 ping 3 vi
JOGL is probably the only option worth considering. Notice that there are at least two options for integrating it into an SWT application. There's a GLCanvas that belongs to SWT and a GLCanvas that belongs to AWT. The one in SWT is not feature complete and is not really maintained. It's much better to use the AWT GLC...
Please don't do that. If you don't want people to alter your Perl code then put it under an appropriate licence and enforce that licence. If people change your code when you licence says that they shouldn't do that, then it's not your problem when your updates not longer work with their installation. See [the Perl F...
XCode integration is something that we at [Teamprise][1] have been looking into a lot. One of the main problems for us is that Apple do not provide a version control API that we can hook into to add a new version control system to XCode - for integrated version control it is either the systems that Apple provide access...
This VBA code will refresh all pivot tables/charts in the workbook. Sub RefreshAllPivotTables() Dim PT As PivotTable Dim WS As Worksheet For Each WS In ThisWorkbook.Worksheets For Each PT In WS.PivotTables PT.RefreshTable Next ...
Why not this: <body> <!-- various content --> <script type="text/javascript"> <!-- myInit(); --> </script> </body> If I understand things correctly, myInit is gonna get executed as soon as browser hit it in the page, which is last thing in a b...
Multithreading or green threading in actionscript?
|multithreading|actionscript|
I was wondering if there are any code or class libraries out the on how to implement multithreading or "green threading" in ActionScript. As you've might seen, Scott Peterson is developing some kind of toolset, but I haven't found any more info on this other than his performance on the Adobe MAX Chicago event. Re...
I was wondering if there are any code or class libraries out there on how to implement multithreading or "green threading" in ActionScript. As you've might seen, Scott Peterson is developing some kind of toolset, but I haven't found any more info on this other than his performance on the Adobe MAX Chicago event. ...
ABAP Column Tree Model doesn't expand node after EXPAND_NO_CHILDREN event
|events|tree|sap|abap|column|expand|
I am displaying a list of items using a SAP ABAP column tree model, basically a tree of folder and files, with columns. I want to load the sub-nodes of folders dynamically, so I'm using the EXPAND\_NO\_CHILDREN event which is firing correctly. Unfortunately, after I add the new nodes and items to the tree, the folder...
|events|tree|sap|abap|columns|expand|
IIS7: HTTP->HTTPS Cleanly
|http|iis-7|https|
Is there a clean way to redirect all attempts to going to an HTTP:// version of a site to its HTTPS:// equivalent?
|https|iis-7|
File downloads in IE6
|php|internet-explorer-6|download|
I've come across a rather interesing (and frustrating) problem with IE6. We are serving up some server generated pdfs and then simply setting headers in PHP to force a browser download of the file. Works fine and all, except in IE6 but **only** if the windows user account is set to standard user (ie. not administrator)...
|php|internet-explorer-6|download|
I still have (some) code I wrote as far back as college, and that would be 18 years ago :-). As is often the case, it is better to have it and never want it, than to want it and not have it.
I would say the reverse is true. At some point, your project gets so expansive, that you actually get slowed down by the shortcomings of the framework. For sufficiently large projects you may, in fact, be better off developing your own framework, to meet your own needs. I have seen many times where people were held ...
My first reaction is to suggest duplicating to the other machine again in a non-dubious manner. If that is not an option, perhaps some of the tools available from [Red Gate][1] could do what you need. (I am in no way affliated with Red Gate, just remember Joel mentioning how good their tools were on the podcast.)...
Having is\_deleted column is a reasonably good approach. If it is in Oracle, to further increase performance I'd recommend partitioning the table by creating a list partition on is_deleted column. Then deleted and non-deleted rows will physically be in different partitions, though for you it'll be transparent. As ...
If you want the simple approach, this should work. You'll want to ".close()" the file first so you know it's flushed to disk from Python. import os os.system("scp FILE USER@SERVER:PATH") #e.g. os.system("scp foo.bar joe@srvr.net:/path/to/foo.bar") You need to set up an ssh key beforehand so that ...
If you want the simple approach, this should work. You'll want to ".close()" the file first so you know it's flushed to disk from Python. import os os.system("scp FILE USER@SERVER:PATH") #e.g. os.system("scp foo.bar joe@srvr.net:/path/to/foo.bar") You need to generate (on the source machine) and ...
cd - It's the command-line equivalent of the back button (takes you to the previous directory you were in).
bash can redirect to and from TCP/IP sockets. /dev/tcp/ and /dev/udp. Some people think it's a security issue, but that's what OS level security like Solaris X's jail is for. As Will Robertson notes, change prompt to do stuff... print the command # for !nn Set the Xterm terminal name. If it's an old Xterm tha...
It sounds like you don't want to compare the two **languages**, but that you want to compare two **web systems**. This is tricky, because there are many variables involved. For example, Python web applications can take advantage of [mod\_wsgi][1] to talk to web servers, which is faster than any of the typical way...
How to determine which version of Direct3D is installed?
|c++|windows|direct3d|
We have an application which needs to use Direct3D. Specifically, it needs at least DirectX 9.0c version 4.09.0000.0904. While this should be present on all newer XP machines it might not be installed on older XP machines. How can I programmatically (using C++) determine if it is installed? I want to be able to give ...
Namespace in C#
|namespaces|
How to get all the classes in a namespace through reflection in C#
|namespaces|.net|reflection|
Getting all types in a namespace via reflection
|.net|reflection|namespaces|
**Tip #1: Avoid all use of XSLT.** The tool support sucks. The resulting solution will be unmaintainable. **Tip #2: Eliminate all unnecessary steps.** Just translate your resultset (assuming you're using JDBC or equiv) to the outbound XML. **Tip #3: Assume all use of a schema-based tool to be incorrect an...
I don't think there is a future for WinForms at all. Since it appears to have been a stop-gap solution even in MSFT world ( a very thin wrapper around Win32). MSFT is rebuilding their WinForms apps in WPF (MSN Messenger, parts of VS) and I have no doubt Mono will be supporting that soon (they support SilverLight all...
I don't think there is a future for WinForms at all. Since it appears to have been a stop-gap solution even in MSFT world ( a very thin wrapper around Win32). MSFT appears to be rebuilding their WinForms apps in WPF (MSN Messenger, parts of VS) and I have no doubt Mono will be supporting that soon (they support Silv...
I don't think there is a future for WinForms at all. Since it appears to have been a stop-gap solution even in MSFT world ( a very thin wrapper around Win32). And virtually no changes seem to have been made to System.Windows.Forms in both .NET 3.0 and 3.5 </speculation> I would use Java or Air.
1. Get a copy of _High Performance MySQL_. Great book. 2. Extended inserts in dumps 3. Dump with --tab format so you can use mysqlimport, which is faster than mysql < dumpfile 4. Import with multiple threads, one for each table. 5. Use a different database engine if possible. importing into a heavi...
I don't know a way in visual studio, because the application settings are bound to the hole project. But a simple way is to use a PreBuild event and copy the app.demo.ico to app.ico or the app.release.ico to app.ico demanding on the value of the key $(ConfigurationName) and refer to the app.ico in your project director...
If you're interested in benchmarking, Rico Mariani has an [excellent 5-part study][1] that covers the qualitative and quantitative differences. He may be an MS guy, but he's know as a performance nut - his benchmarks are thorough and well thought out. [1]: http://blogs.msdn.com/ricom/archive/2007/06/22/dlinq-...
If you're interested in benchmarking, Rico Mariani has an [excellent 5-part study][1] that covers the qualitative and quantitative differences. He may be an MS guy, but he's known as a performance nut - his benchmarks are thorough and well thought out. [1]: http://blogs.msdn.com/ricom/archive/2007/06/22/dlinq...
I'd highly recommend you use the [Spring abstractions for JMS such as the MessageListenerContainer](http://static.springframework.org/spring/docs/2.5.x/reference/jms.html#jms-mdp) to deal with reconnection, transactions and pooling for you. You just need to supply a MessageListener and configure the MessageListenerCont...
Why? If you need during page generation for a image or css file URL, what's wrong with [ServletRequest.getLocalPort()][1] or, better yet, [HttpServletRequest.getContextPath()][2] for the whole shebang? [1]: http://java.sun.com/javaee/5/docs/api/javax/servlet/ServletRequest.html#getLocalPort() [2]: http://j...
Writing a ++ macro in Common Lisp
|lisp|macros|
I've been attempting to write a Lisp macro that would perfom the equivalent of ++ in other programming languages for semantic reasons. I've attempted to do this in several different ways, but none of them seem to work, and all are accepted by the interpreter, so I don't know if I have the correct syntax or not. My id...
I've been attempting to write a Lisp macro that would perfom the equivalent of ++ in other programming languages for semantic reasons. I've attempted to do this in several different ways, but none of them seem to work, and all are accepted by the interpreter, so I don't know if I have the correct syntax or not. My id...
I think it has to also do with the frequency of each term (i.e. an index of 10,000 copies of the sames terms should be much smaller than an index of 10,000 wholly unique terms). Also, there's probably a small dependency on whether you're using Term Vectors or not, and certainly whether you're storing fields or not. ...
ICS components from http://www.overbyte.be are great. a.) Better compatibility than Indy b.) PostCard ware Good examples and support. Use TClientSocket and TServerSocket
How would I go about creating a custom search index much like Lucene?
|search|indexing|multilingual|
I implemented a Lucene search solution awhile back, and it got me interested in compressed file indexes that are searchable. At the time I could not find any good information on how exactly you would go about creating a custom search index, so I wonder if anyone can point me in the right direction? My primary interest ...
How can I post a Cocoa "sheet" on another program's window?
|mac|osx|cocoa|
Using the Apple OS X Cocoa framework, how can I post a *sheet* (slide-down modal dialog) on the window of another process? Interprocess cooperation (such as passing a reference of some kind) is acceptable: both processes are mine, but I want to avoid binding the sheet's code into the primary process.
@Vinko Vrsalovic, as I wrote in question I know hot to do it in most DBs. I what to find universal solution or get a proof that it doesn't exist. Here is one stupid solution based on temporary table. It's obviously bad, so no need to comment on it. N - upper bound M - lower bound create #temp ...
@Vinko Vrsalovic, as I wrote in question I know how to do it in most DBs. I what to find universal solution or get a proof that it doesn't exist. Here is one stupid solution based on temporary table. It's obviously bad, so no need to comment on it. N - upper bound M - lower bound create #temp ...
[Google Gears][1] has a built-in sqlite database - but you'll need to ensure that people have it installed if you plan to rely on it. Depending on your circumstances, you may be able to enforce installation, otherwise you should treat it as a nice-to-have, but have graceful degradation so that the site still works i...
In the OSS space (though I've never used them as a BizTalk replacement personally - this is anecdotal) you can use one of the Java/J2EE Messaging engines such as [OpenMQ][1] (which is the Sun enterprise one rebadged and without support). If you need Orchestration / Choreography (i.e. SOA/ESB pieces) on top of this, yo...
I would agree strongly with the point that it is only worth using TFS if you know exactly what you need it for. The OSS-based, cheap or free add-ins like Visual SVN and TestDriven.Net are so good that integration with VS is seamless already.
First you should read this [What Every Computer Scientist Should Know About Floating Point Arithmetic][1]. Then you should really consider using some type of [fixed point / arbitrary-precision number][2] package (e.g. java BigNum, python decimal module) otherwise you'll be in for a world of hurt. Then figure out if usi...
xslt and xpath: match conditionally upon current node value
|xslt|xpath|
given the following xml: <current> <login_name>jd</login_name> </current> <people> <person> <first>John</first> <last>Doe</last> <login_name>jd</login_name> </preson> <person> <first>Pierre</first> <last>Spring</last> <lo...
I could not find the previous thread, because I was searching for "vsmacros" instead of "vsmacros80". There are currently 5 different entries in `Tools->Options->Addin/Macro Security` %ALLUSERSPROFILE%\Application Data\Microsoft\MsEnvShared\Addins %APPDATA%\Microsoft\MsEnvShared\Addins %VSAPPDATA%\A...
Well two webservices that don't reference each other might be a good example of 100% decoupled. The coupling would then arrive in the form of an app util that "couples" them together by using them both. Coupling isn't inherently bad but you do have to make solid judgement calls about when to do it (is it only at Im...
The answer is: Whatever best fits the job! My rule of thumb; **Bash** - for a short script that might need a for loop to do something repetitively. **Perl** - anything to do with some kind of text processing or file processing, especially if it's a one off. Just do a dirty nasty perl script and be done with it...
Right. Even if you write to an interface or a protocol, you are committing to something. You can peacefully forget about 100% decoupling and rest assured that whatever you do, you cannot just snap out one component and slap another in its place without at least minor modifications anyway, unless you are committing to v...
Karl just released v2 of his XAML Power toys and it can reformat your xaml from VS2008! Check out the video about XAML Power Toys Accessories [http://karlshifflett.wordpress.com/2008/09/16/xaml-power-toys-v2-release-finally-code-name-hawaii/][1] [1]: http://karlshifflett.wordpress.com/2008/09/16/xaml-power-to...
I prefer shell scripts only for very small tasks. Writing robust shell scripts requires a lot of knowledge about possible pitfalls, which you only learn by doing. But learning even the basics will increase your productivity a lot! If I need to have complex logic, I usually use Python. By complex I mean anything that...