instruction stringlengths 0 30k ⌀ |
|---|
Any better way to create MediaWiki numbered lists? |
|wiki|mediawiki| |
When using MediaWiki's markup language, the only thing that I hate is creating numbered lists. The only way I know to create a list is to do something like this:
#Item1
#Item2
However, if I want to add spaces or some other text between those lines, the numbering gets lost. For example, the following will... |
Here is a really interesting article about how to write one: (Even better, he gives the full source to a JavaScript formatter and colorizer.)
[Implementing a syntax-higlighting JavaScript editor in JavaScript](http://marijn.haverbeke.nl/codemirror/story.html)
or
A brutal odyssey to the dark side of the DOM tree
... |
Best ways to teach a beginner to program? |
|language-agnostic|python| |
I am currently engaged in teaching my brother to program. He is a total beginner, but very smart. I've noticed that some of our sessions have gotten bogged down in minor details, and I don't feel I've been very organized.
What can I do to teach him effectively? Is there a logical order that I can use to run throu... |
I am currently engaged in teaching my brother to program. He is a total beginner, but very smart. I've noticed that some of our sessions have gotten bogged down in minor details, and I don't feel I've been very organized.
What can I do better to teach him effectively? Is there a logical order that I can use to ru... |
|language-agnostic|python| |
If you are on Windows, you could use[CoCreateGUID][1] API.
[1]: http://msdn.microsoft.com/en-us/library/ms688568(VS.85).aspx |
If you are on Windows, you could use[CoCreateGUID][1] API, on Linux you can use /proc/sys/kernel/random/uuid.
[1]: http://msdn.microsoft.com/en-us/library/ms688568(VS.85).aspx |
If you are on Windows, you could use[CoCreateGUID][1] API, on Linux you can use /proc/sys/kernel/random/uuid, you can also look at 'libuuid'.
[1]: http://msdn.microsoft.com/en-us/library/ms688568(VS.85).aspx |
What about an enumeration? |
This sounds like a homework problem to me. Oh well, it's your life.
You failed to specify the type of the variable that contains the "input integer". If the input integer is an integral type (say, an "int") try this:
int countOnes(int input)
{
int result = 0;
while(input) {
... |
If you are concerned with speed make sure you use prepared statements. Otherwise I am with ilitirit that changes is what you protect yourself against.
/Allan |
Modern browsers either don't appear to support SSLv2 at all (Google Chrome, Opera 9.52, Firefox) or have it disabled by default (IE7, IE8).
That said, are you concerned about losing business from people using much-less-than-modern web browsers?
Possibly more importantly, are you concerned about your customers' se... |
Although this link doesn't address your question directly, its fairly comprehensive in terms of design considerations for Report Rendering in in Excel
Link: [Designing for Microsoft Excel Output][1](Reporting Services)
[1]: http://msdn.microsoft.com/en-us/library/ms159836(SQL.90).aspx |
I would highly advise against having a single constants class. It may seem a good idea at the time, but when developers refuse to document constants and the class grows to encompass upwards of 500 constants which are all not related to each other at all (being related to entirely different aspects of the application),... |
I agree with Mr. Martinez in that I wouldn't port any existing projects up to the 3.5 framework, but the split designer and javascript debugging is worthwhile on its own. |
In defense of singletons:
* **They are not as bad as globals** because globals have no standard-enforced initialization order, and you could easily see nondeterministic bugs due to naive or unexpected dependency orders. Singletons (assuming they're allocated on the heap) are created after all globals, and in a v... |
Cliki is a good resource for Common Lisp libraries:
http://www.cliki.net/database
There is a project named Elephant (http://common-lisp.net/project/elephant/index.html), which is an abstraction for object persistence in CL. |
All functions are actually instances of the built-in **Function** type, which has a constructor that takes a string containing the function definition, so you can actually define functions at run-time by e.g., concatenating strings:
//e.g., createAddFunction("a","b") returns function(a,b) { return a+b; }
fu... |
ALTER TABLE dbo.<tablename> ADD CONSTRAINT
<namingconventionconstraint> UNIQUE NONCLUSTERED
(
<columnname>
) ON [PRIMARY]
|
In ruby:
str = "a"
100_000_000.times {puts str.next!}
It is quite fast, but it is going to take some time =). Of course, you can start at "aaaaaaaa" if the short strings aren't interesting to you. |
In ruby:
str = "a"
100_000_000.times {puts str.next!}
It is quite fast, but it is going to take some time =). Of course, you can start at "aaaaaaaa" if the short strings aren't interesting to you.
I might have misinterpreted the actual question though - in one of the posts it sounded as if you just ne... |
What is the best tool to find which DLL another VB6 DLL is referenced to? |
|vb6|dll|reference| |
This is an antique problem with VB6 DLL and COM objects but I still face it day to day. What is the best tool to see which DLL file or version another DLL is referencing to?
Of course, this is from the OS point of view - compiled DLLs not from within VB6 IDE.
It's DLL hell. |
Here is a simple batch script getdrive.cmd to find a drive letter from a volume label. Just call "getdrive MyLabel" or getdrive "My Label".
@echo off
setlocal
:: Initial variables
set TMPFILE=%~dp0getdrive.tmp
set driveletters=abcdefghijklmnopqrstuvwxyz
set MatchLabel_res=
... |
Try [Nagios][1], it's the default tool to monitor servers. You can write plugins to report just about any data.
[1]: http://www.nagios.org/ |
Occasionally either myself or one of my co-workers will spend a couple of hours getting to the bottom of slightly obscure bug and once the cause of the bug is found 90% of the time that code isn't unit tested. The unit test doesn't exist because the dev is cutting corners to save time, but then looses this and more de... |
There is ICEFaces which provides more semantic support than RichFaces .Also you can try Nitobi suite which also provides similar kinda solution.If you are not satisfied with any of these I suggest try to write your own part extending the Sun faces
|
[Dependency Walker][1] shows you all the files that a DLL links to (or is trying to link to) and it's free.
[1]: http://www.dependencywalker.com/ |
It sounds like you may be running into a garbage collection issue with the flash player.
A new API has been added to Flash Player 10 that should address this:
unloadAndStop()
Grant Skinner has more info on this on his blog:
<http://www.gskinner.com/blog/archives/2008/07/unloadandstop_i.html>
You can grab a... |
|python|language-agnostic| |
I am currently engaged in teaching my brother to program. He is a total beginner, but very smart. I've noticed that some of our sessions have gotten bogged down in minor details, and I don't feel I've been very organized.
What can I do better to teach him effectively? Is there a logical order that I can use to ru... |
I am currently engaged in teaching my brother to program. He is a total beginner, but very smart. I've noticed that some of our sessions have gotten bogged down in minor details, and I don't feel I've been very organized.
What can I do better to teach him effectively? Is there a logical order that I can use to ru... |
What is going on???? Nested classes??? WTF? I thought we were all professionals on here.
This is what the Internal Constructor is for.
public class AbstractClass
{
public AbstractClass ClassFactory(string args)
{
switch (args)
{
case "A":
... |
If you are using this class in a seperate service assembly, you can use the internal keyword.
public class AbstractClass
{
public AbstractClass ClassFactory(string args)
{
switch (args)
{
case "A":
return new ConcreteClassA();... |
For anything long term I would try to avoid datagrid/gridview, it sometimes becomes too hacky making it do exactly what you want, after a certain number of these tweaks you start to realise its not saving time in the long run and you might not be getting the control over markup that you need.
However the built in pa... |
Komodo from Activestate is a good IDE for Windows/Linux. There is a trial version - I am not sure if there is a free version after trial though. |
[@JasonBunting][1]
>>Here is a decent article on how to accomplish that.
That's not a great article - it's seven years old and doesn't mention the CSS capabilities of Flash. It covers only the basics of HTML support in Flash.
Adobe have a more authoritative page here: [Using HTML text formatting in Flash CS3 P... |
You could also do your testing right there on the web server. Then ClientTransmission time becomes effectively 0. |
I don't recommend BeautifulSoup if you want speed. lxml is much, much faster, and you can fall back in lxml's BS soupparser if the default parser doesn't work. |
I think that it depends on the type of your product. If it is directed to be used by developers - obfuscation will hurt your customers. We've been using the ArcGIS products at work, and all the DLLs are obfuscated. It's making our job a lot harder, since we can't use Reflector to decipher weird behaviors. And we're buy... |
How do I reference a local resource in generated HTML in WinForms WebBrowser control? |
|winforms|webbrowser| |
I'm using a winforms webbrowser control to display some content in a windows forms app. I'm using the DocumentText property to write the generated HTML. That part is working spectacularly. Now I want to use some images in the markup. (I also would prefer to use linked CSS and JavaScript, however, that can be worked... |
If you are going to have many function pointers as parameters I would recommened that you use typedefs. For example.
typedef void (*functiontype)();
Declares a function that returns void and takes no arguments. To create a function pointer to this type you can now do:
void dosomething() { }
func... |
**Original Question**
I am currently engaged in teaching my brother to program. He is a total beginner, but very smart. I've noticed that some of our sessions have gotten bogged down in minor details, and I don't feel I've been very organized.
What can I do better to teach him effectively? Is there a logical o... |
**Original Question**
I am currently engaged in teaching my brother to program. He is a total beginner, but very smart. I've noticed that some of our sessions have gotten bogged down in minor details, and I don't feel I've been very organized.
What can I do better to teach him effectively? Is there a logical o... |
Upgrade, you will not regret it in the slightest. In particular, Linq is going to make your life so much easier. There there are the extensions for c#.
That's barely touching the surface, there is certainly new toys in the area you are developing as well, either web, desktop or server.
|
akamai caching and site rendering |
|caching|rendering|akamai| |
I am the web guy for a large TV station. Our site is cached by Akamai. Pages render perfectly in our testing environment (not cached) and on our "origin" page (again, not cached), but when they are viewed on our live environment (the cached site), they do not render exactly the same as how I coded them. Maybe it's a ti... |
<a href="http://en.wikibooks.org/wiki/Haskell/Understanding_arrows">http://en.wikibooks.org/wiki/Haskell/Understanding_arrows</a> |
I'd upgrade, but set aside some time for the install process. It took two hours on my moderately fast dev workstation, and I'm still doing updates, patches, hotfixes, two hours after the install finished... (haven't gotten any "real work" done today at all!) |
If you treat each denomination as a point on a base-n number, where n is the maximum number of notes you would need, then you can increment through that number until you've exhausted the problem space or found a solution.
The maximum number of notes you would need is the Total you require divided by the lowest deno... |
If you treat each denomination as a point on a base-n number, where n is the maximum number of notes you would need, then you can increment through that number until you've exhausted the problem space or found a solution.
The maximum number of notes you would need is the Total you require divided by the lowest deno... |
> Have you ever created a window using WinAPI?
More times than I care to remember.
> Then you should know that you define a class (RegisterClass), create an instance of it (CreateWindow), call virtual methods (WndProc) and base-class methods (DefWindowProc) and so on. WinAPI even takes the nomenclature from Small... |
You'll have to grant write permissions, but you can check the file's mime type to ensure an image. You can use FSO as so:
set fs=Server.CreateObject("Scripting.FileSystemObject")
set f=fs.GetFile("upload.jpg")
'image mime types or image/jpeg or image/gif, so just check to see if "image" is instr
... |
Recommendations for browser add-on tools to help with development |
|web|development|softwaretools|browsers| |
Can anyone suggest some good browser add-on tools/extensions to help with development?
I have firebug installed in Firefox which is great for dealing with CSS, HTML and javascript; any other suggestions?
[Firebug][1]
[1]: https://addons.mozilla.org/en-US/firefox/addon/1843 |
|web|development|softwaretools|browser| |
|web|development|browser|software-tools| |
Holy wars! Ok let me see.. Last time I checked the design police said..
Singletons are bad because they hinder auto testing - instances cannot be created afresh for each test case.
Instead the logic should be in a class (A) that can be easily instantiated and tested. Another class (B) should be responsible for cons... |
Building Standalone Applications in JavaScript |
|javascript|browsers|deployment| |
With the increased power of JavaScript frameworks like YUI, JQuery, and Prototype, and debugging tools like Firebug, doing an application entirely in browser-side JavaScript looks like a great way to make simple applications like puzzle games and specialized calculators.
Is there any downside to this other than expo... |
I agree with @BradS too BTW
BTW [here's a way of hiding the middleware from your business logic](http://activemq.apache.org/camel/hiding-middleware.html) while still getting the benefits of loose coupling & SEDA - while being able to easily switch between a variety of different middleware technology - from in memory... |
scope resolution operator without a scope |
|c++| |
In C++, what is the purpose of the scope resolution operator when used without a scope? For instance:
::foo();
|
Something like this in .htacces should do it:
RewriteEngine On
RewriteRule ^/?$ /punbb/ [R=301,L]
The 301 return code is to mark the move as permanentm making it posible for the browser to update bookmarks. |
You might be interested in [Sun's Lively][2].
There will also probably be more tools that compile to HTML+JavaScript, so you won't have to deal with them directly (like GWT.) There are also projects that try compile other languages to work in the browser (like [HotRuby][1]).
[1]: http://hotruby.yukoba.jp/
... |
I always put it on my [blog](http://blog.gadodia.net). Not only am I able to get back to it later, there is also a chance that it can help someone else as well. |
Installing just Quicktime libraries on Windows |
|windows|installation|quicktime| |
There's [Quicktime SDK][1] for Windows, but any application that uses it needs quicktime runtime libraries to be installed on the system (SDK itself just has headers and library stubs, and not the actual DLLs).
If my application uses Quicktime, I'd like to install the necessary libraries with it's installer, thus no... |
There's [Quicktime SDK][1] for Windows, but any application that uses it needs quicktime runtime libraries to be installed on the system (SDK itself just has headers and library stubs, and not the actual DLLs).
If my application uses Quicktime, I'd like to install the necessary libraries with it's installer, thus no... |
This question already has the answer for defining function pointers, however they can get very messy, especially if you are going to be passing them around your application. To avoid the unpleasantness I would recommend that you typedef the function pointer into something more readable. For example.
typedef void... |
This question already has the answer for defining function pointers, however they can get very messy, especially if you are going to be passing them around your application. To avoid the unpleasantness I would recommend that you typedef the function pointer into something more readable. For example.
typedef void... |
This question already has the answer for defining function pointers, however they can get very messy, especially if you are going to be passing them around your application. To avoid this unpleasantness I would recommend that you typedef the function pointer into something more readable. For example.
typedef voi... |
This question already has the answer for defining function pointers, however they can get very messy, especially if you are going to be passing them around your application. To avoid this unpleasantness I would recommend that you typedef the function pointer into something more readable. For example.
typedef voi... |
Any of the hash-based methods may produce bad results because more than one string can produce the same hash. (It's not likely, but it's possible.) This is particularly true of the suggestion to add the hashes, since you would essentially be taking a *particularly bad* hash of the hash values.
A hash method should... |
WSO2 Web Services Framework for C++ (WSO2 WSF/C++), a binding of WSO2 WSF/C into C++ is a C++ extension for consuming Web Services in C++.
http://wso2.org/projects/wsf/cpp
Apache Axis is an open source, XML based Web service framework. It consists of a Java and a C++ implementation of the SOAP server, and various... |
Look inside the docs for [Sandcastle][1]. This is the new documentation standard for .NET.
[1]: http://blogs.msdn.com/sandcastle/ |
Try using the built-in command instead:
(Get-Command C:\Path\YourFile.Dll).FileVersionInfo
or
ls *.dll,*.exe | %{gcm $_.FullName} | select -expand File* |
Try using the built-in command instead:
(Get-Command C:\Path\YourFile.Dll).FileVersionInfo
or
dir *.dll,*.exe | %{gcm $_.FullName} | select -expand File* |
If you're fearing classitus, try using an id on a parent or child selector that contains the element that you wish to style. This parent element should NOT have the runat server applied. Simply put, it's a good idea to plan your structural containers to not run code behind (ie. no runat), that way you can access majo... |
int countDigit(int Number, int Digit)
{
int counter = 0;
do
{
if( (Number%10) == Digit)
{
counter++;
}
}while(Digit>0)
return counter;
} |
Check out microsoft for an [XML Notepad 2007][1]. I'm not to fond of it, since it really treats xml as a tree as opposed to plain text, but that is what you want, right?
[1]: http://www.microsoft.com/downloads/details.aspx?familyid=72d6aa49-787d-4118-ba5f-4f30fe913628&displaylang=en |
I found Hughes' original paper ("Generalizing Monads to Arrows") to be fairly accessible. You can read an older draft of it [here][1]. It has some differences from the original paper, which are noted on the [bibliography page][2] of Ross Patterson's own [overview of Arrows][3].
[1]: http://www.cs.chalmers.se/~... |
Depends on what you're going to be doing with it. If you're going to need to do frequent searching against certain bits of it, you'll want to break it up in a way that makes sense for your usage case. If it's just for something like storage of e-mail for Sarbanes-Oxley compliance, you'd probably be okay storing the w... |
me.yahoo.com/a/kUQ7zeQ: but even if I set the property to an empty string as mentioned, the `row_activated` handler is still called when I double-click on a row (or press Enter or Space). So the treeview still gets events... |
Storing email messages in a database |
|database|email|schema| |
What sort of database schema would you use to store email messages, with as much header information as practical/possible, into a database?
Assume that they have been fed into a script from the MTA and parsed into the relevant headers/body/attachments.
Would you store the message body whole in the database table,... |
|database|email|schema| |