instruction
stringlengths
0
30k
|emacs|editor|
So that each line starts with its line number?
It might be worth saying that the first thing to do is get to know the libraries in the newer versions of Java. A lot of ideas have worked their way back into java - java.util.concurrent, java.nio, and javax.xml
Apache's [Jakarta Commons][1]. [1]: http://commons.apache.org/
##Perl 6 sub join( $separator, @strings ){ my $return = shift @strings; for @strings -> ( $string ){ $return ~= $separator ~ $string; } return $return; } *Yes I know it is pointless because Perl 6 already has a join function.*
DannySmurf, <tt>&lt;meta></tt> elements are extremely unreliable when it comes to controlling caching, and <tt>Pragma</tt> in particular even more so. <a href="http://www.mnot.net/cache_docs/#META">Reference</a>.
The [CryptUnprotectData function][1] documentation states that it usually only works when the user has the same logon credentials as the encrypter. This suggests to me that maybe the key is tied to the user's current token. Since you mention Vista, this makes me think UAC and restricted tokens. Can you show us so...
You didn't say so, but it sounds like you're starting emacs from a Windows shortcut. The directory that you see with c-x c-f is the pwd, which for a Windows shortcut is specified in the "Start In" field in the properties. Right click on the shortcut, select properties, and type the path to your desktop in the "Star...
You didn't say so, but it sounds like you're starting emacs from a Windows shortcut. The directory that you see with c-x c-f is the pwd, which for a Windows shortcut is specified in the "Start In" field in the properties. Right click on the shortcut, select properties, and type the path to your desktop in the "Star...
I use the free [AutoHotKey](http://www.autohotkey.com/), then I define my own shortcuts: * dobule tap F4 quickly => Close active Windows (like Alt+F4 but with one finger only) * double tap Right Alt quickly => [Find and Run Robot](http://www.donationcoder.com/Software/Mouser/findrun/index.html) task manager * F12 ...
In IIS? Go to security settings and hit "Require secure connection". Alternately, you can check the server variables in page load and redirect to the secure page.
From a comment on the first LifeHacker link, How to make x² your default folder application As part of the installation process, x² adds "open with xplorer2" in the context menu for filesystem folders. If you want to have this the default action (so that folders always open in x2 when you click on them) then...
For this sort of password, I tend to use a system that's likely to generate more easily "used" passwords. Short, often made up of pronouncable fragments and a few numbers, and with no intercharacter ambiguity (is that a 0 or an O? A 1 or an I?). Something like string[] words = { 'bur', 'ler', 'meh', 'ree' }; ...
If you're running Apache, you can put a `RewriteRule` in your `.htaccess`, like so: RewriteCond %{HTTPS} "off" RewriteRule /mypage.html https://example.com/mypage.html
Sure: if you want to make sure that _both_ sides of the expression are evaluated. This might be the case if, for example, both sides are method calls that return booleans as a result of some other operation. But in general, you should AndAlso/OrElse whenever you would use &&/|| in C/C++/C#, which of course is the v...
I like to look at generating passwords, just like generating software keys. You should choose from an array of characters that follow a good practice. Take what [@Radu094 answered][1] with and modify it to follow good practice. Don't put every single letter in the character array. Some letters are harder to say or ...
I recently wrote a little C# GUI application on Linux, compiling and running using mono. I found that I had to use the "gmcs" compiler in order to have access to modern C# and .Net features (mono 1.9 ships with several different compilers). And when compiling the .exe file, I found that I had to add the "-target:win...
Yes you can, I have a 64-bit Debian running in VMWare on XP 32-Bit. As long as you set the Guest to use 2 processors it will work just fine.
For the first one, first calculate the product of entire contents of input, and then for every element of index, divide the calculated product by input[index[i]], to fill in your result array. Of course I have to assume that the input has no zeros.
you'll have to do both the remove and ignore operation - first make a backup of your local file (like @ibz said) - then remove the web.config from the repository. - then copy back the web.config to the same folder - finally use svn:ignore so that subversion does not try to add it again to the repository
you'll have to do both the remove and ignore operation - first make a backup of your local file (like @ibz said) - then remove the web.config from the repository. - then copy back the web.config to the same folder - finally use svn:ignore so that subversion does not try to add it again to the repository ...
You could use TidyNet.Tidy to convert the HTML to XHTML, and then use an XML parser. Another alternative would be to use the builtin engine mshtml: using mshtml; ... object[] oPageText = { html }; HTMLDocument doc = new HTMLDocumentClass(); IHTMLDocument2 doc2 = (IHTMLDocument2)doc; d...
Python: if s == s[::-1]: return True
Python: if s == s[::-1]: return True Java: if (s.Equals(s.Reverse())) { return true; } PHP: if (s == strrev(s)) return true; Perl: if (s == reverse(s)) { return true; } Erlang: string:equal(S, lists:reverse(S)).
From the [EmacsWiki Aquamacs FAQ][1]: > To change the font used to display the > current frame, go to the font panel. > You can do this with the keystroke > Apple-t, or via the menu: Options → > Show/Hide → Font Panel. Once there, > select the font you want. > > To make the current frame’s font the > defaul...
I agree with the other posts: * inline may be superfluous because the compiler will do it * inline may bloat your code A third point is it may force you to expose implementation details in your headers, .e.g., class OtherObject; class Object { public: void someFunc(OtherObject& otherO...
My personal experience: - Project size: Very large (150+ persons) - Project time: Very long (+6 years) - Project income (estimated): 40 Million $ (Military is paying) - Project life cycle: Incremental lyfetime. Main milestones every year. - Project structure: Traditional at fir...
What are the CSS secrets to a flexible/fluid HTML form?
|html|css|
The below HTML/CSS/Javascript(JQuery) code displays the #makes select box. Selecting an option displays the #models select box with relevant options. The #makes select box sits off center and the #models select box fills the empty space when it is displayed. How do you style the form so that the #makes select box i...
All of the methods mentioned above are really good, but personally I like [SVG::TT::Graph][1]. I really like the power that SVG gives you to draw really nice-looking graphs. [1]: http://search.cpan.org/dist/SVG-TT-Graph/
You could try this: find. -name *.ear -exec du {} \; This will give you the size in bytes. But the du command also accepts the parameters -k for KB and -m for MB. It will give you an output like 5000 ./dir1/dir2/earFile1.ear 5400 ./dir1/dir2/earFile2.ear 5400 ./dir1/dir3/earFile1.ear
You can use either Lua or Python. Lua is more "lightweight" than python. It's got a smaller memory footprint than python does and in our experience was easier to integrate (people's mileage on this point might vary). It can support a bunch of scripts running simultaneously. Lua, at least, supports stopping/starting...
find . -name "*.ear" | xargs ls -sh
a simple solution is to use the -ls option in find: find . -name \*.ear -ls That gives you each entry in the normal "ls -l" format. Or, to get the specific output you seem to be looking for, this: find . -name \*.ear -printf "%p\t%k KB\n" Which will give you the filename followed by the size in KB.
XMLRPC is very simple to get started with, and at my previous job, we used it extensively for intra-node communication in a distributed system. As long as you keep track of the fact that the None value can't be easily transferred, it's dead easy to work with, and included in Python's standard library. Run it over h...
I'd suggest looking at the request in the code that renders the form, and if it is not using SSL, issue a redirect to the https URL. You could also use a rewite rule in Apache to redirect the user. Or, you could just not serve up the page via HTTP, and keep it only in the document root of your HTTPS site.
From [MSDN](http://msdn.microsoft.com/en-us/library/wz3k228a.aspx): **Short-Circuiting Trade-Offs** *Short-circuiting can improve performance by not evaluating an expression that cannot alter the result of the logical operation. However, if that expression performs additional actions, short-circuiting skips those...
Well to be honest, you **can't** make everyone settle on one solution. You can suggest a solution and point out it's benefits, but eventually the advantages would have to be greater than the inertia that they have built up with their present library. To make them settle on one library you would need to go up the man...
If you go to Control Panel -> Folder Options And go to the File Types tab. You can go to the "Folder" file type (with "(NONE)" as the extension). Go to Advanced, create a new action that uses your program (I tried it with FreeCommander). Make sure you set it as default. That should do it.
[Audiobook Maker][1] does something like this, and I believe it uses ffmpeg under the hood. It's open source, so maybe its worth a look? [1]: http://audiobookmaker.sourceforge.net/
Rehsarper 4.0 - Renaming a class does not rename the file
|visual-studio|resharper|
I probably set something on accident in the options, but I can't find it. Any ideas?
There is no reason why you shouldn't use GAE and Google Web Toolkit (GWT) together. You write your backend code in Python and the frontend code in Java (and possibly some JavaScript), which is then compiled to JavaScript. When using another AJAX framework you will also have this difference between server and client sid...
Best xml writing tool for Python
|python|xml|xhtml|
I'm currently trying ElementTree and it looks fine, it escapes HTML entities and so on and so forth. I'm just wondering if I'm missing something truly wonderful I haven't heard of. This is similar to what I'm actually doing import xml.etree.ElementTree as ET root = ET.Element('html') head = ET.SubEl...
Vaibhav, unfortunately we have to assume, that there could be a 0 in the input table.
It sounds as though you're interested in synchronization techniques rather than communication. If so, you might like to start [here][1], or perhaps this more [concise overview][2]. HTH, Kent [1]: http://msdn.microsoft.com/en-us/library/ms228964.aspx [2]: http://marekblog.wordpress.com/2007/02/05/net-frame...
The angle you want is the same as the angle opposed to the one wetween y and h. Let's call `a` the angle between `y` and `h`, the angle you want is actually `180 - a` or `PI - a` depending on your unit (degrees or radians). Now geometry tells us that: cos(a) = y/h sin(a) = x/h tan(a) = x/y Us...
Can I turn off automatic merging in Subversion?
|tortoisesvn|subversion|
We're looking at moving from a check-out/edit/check-in style of version control system to Subversion, and during the evaluation we discovered that when you perform an Update action in TortoiseSVN (and presumably in any Subversion client?), if changes in the repository that need to be applied to files that you've been e...
(I used to write customer apps for Windows Mobile.) Forget about python. Even if it's technically possible: * your app will be big (you'll have to bundle the whole python runtime with your app) * your app will use lots of memory (python is a memory hog, relative to C/C++) * your app will be slow * you wont fin...
This is what I have in my .emacs for OS X: (set-default-font "-apple-bitstream vera sans mono-medium-r-normal--0-0-0-0-m-0-mac-roman") Now, I'm not sure Bitstream Vera comes standard on OS X, so you may have to either download it or choose a different font. You can search the X font names by running `(x-list-...
For my own personal projects I just dive right in. Of course, none of these have yet been sufficiently large as to require any sort of pre-planning. If this is going to be a serious project or a relatively large scale, it is always a good idea to flush out at least what each part of the program needs to do and a high...
Try [Console 2](http://sourceforge.net/projects/console/).
Take a look at [Take Command](http://www.jpsoft.com).
Try these: [Windows PowerShell][1], a managed command interpreter from Microsoft. [Take Command][2]. This one has been around for a long time (formerly 4DOS). I used this on Windows NT 3.5 (!) and loved it. [Cygwin][3] lets you run Unix shells on Windows. [1]: http://www.microsoft.com/windowsserver2003/tech...
I spend a lot of time thinking about the various aspects of the project before I even touch a keyboard. I go through what I've learnt from previous projects and write it down in various categories ('technical', 'promotion', etc) Personal project or not, I always set up source code control. Git, Mercurial of Bazaa...
I've had these issues too for years on Windows, but I recently found this project: [Console][1] It still requires "mark mode" for copy/paste, but at least it's available from a right-click contextual menu (so you don't need to move the mouse to the top left and then move it again to the text you want to select) ...
Yeah, just separate them into different script tags: <script language="javascript"> // javascript code </script> <script language="vbscript"> ' vbscript code </script>
Yeah, just separate them into different script tags: <script language="javascript"> // javascript code </script> <script language="vbscript"> ' vbscript code </script> Edit: And, yeah, you can cross call between Javascript and VBScript with no extra work.
Guessing: truncate table bundle_inclusions
[HTTP][1] seems to suit your requirements and is very well supported in Python. [1]: http://www.ietf.org/rfc/rfc2616.txt
[HTTP][1] seems to suit your requirements and is very well supported in Python. [Twisted][2] is good for serious asynchronous networking, but has a steep learning curve. [1]: http://www.ietf.org/rfc/rfc2616.txt [2]: http://twistedmatrix.com/
[HTTP][1] seems to suit your requirements and is very well supported in Python. [Twisted][2] is good for serious asynchronous network programming in Python, but it has a steep learning curve, so it might be worth using something simpler unless you know your system will need to handle a lot of concurrency. To sta...
find . -name '*.ear' -exec ls -lh {} \; just the h extra from jer.drab.org's reply. saves time converting to MB mentally ;)
Use the current application culture: DateTime.ParseExact("2008/12/05", "yyyy/MM/dd", System.Globalization.CultureInfo.CurrentCulture); You can set the application culture in the app.config using the Globalization tag. I think.
Personally, I like [`mumamo-mode`](http://www.emacswiki.org/cgi-bin/wiki/MuMaMo). I'm not sure if you're including that in your problem description, since it does rely on (and is usually downloaded with) `nxhtml-mode`. So I don't know if you're using `mumamo` or just some aspect of `nxhtml` that lets you use multiple m...
We don't use obfuscation for "non public" applications but we use it for public available applications. The obfuscated app contains plenty of highly sophisticated code which took us an exorbitant amount of time to write and that's the reason that let me think that obfuscation is a must - at least in that case.
You could also simply create the IFormatProvider once and store it for later use.
Z-80 assembler -- at memory location 0x0000: rst 00 one byte -- 0xC7 -- endless loop of pushing the current PC to the stack and jumping to address 0x0000.
You didn't say so, but it sounds like you're starting emacs from a Windows shortcut. The directory that you see with c-x c-f is the cwd, which for a Windows shortcut is specified in the "Start In" field in the properties. Right click on the shortcut, select properties, and type the path to your desktop in the "Star...
You didn't say so, but it sounds like you're starting emacs from a Windows shortcut. The directory that you see with c-x c-f is the cwd, which for a Windows shortcut is specified in the "Start In" field in the properties. Right click on the shortcut, select properties, and type the path to your desktop in the "Star...
You didn't say so, but it sounds like you're starting emacs from a Windows shortcut. The directory that you see with c-x c-f is the cwd, which for a Windows shortcut is specified in the "Start In" field in the properties. Right click on the shortcut, select properties, and type the path to your desktop in the "Star...
Convert WAV to WMA using .NET
|.net|audio|wma|
What is the best solution for converting WAV files to WMA (and vice versa) in C#? I have actually implemented this once already using the Windows Media Encoder SDK, but having to distribute Windows Media Encoder with my application is cumbersome to say the least. The Windows Media Format SDK has large sections of the A...
How to program simple chat bot AI?
|language-agnostic|ai|bots|
I want to build a bot that asks someone a few simple questions and branches based on the answer. I realize parsing meaning from the human responses will be challenging, but how do you setup the program to deal with the "state" of the conversation? EDIT: It will be a one-to-one conversation between a human and the b...
[@oops][1] Well, I would say that kind of extra work is not typically very helpful, more because it can obscure the code rather than an issue of performance. When dealing with performance, I feel it's always best to focus on code clarity and then performance when you have real statistics that indicate a problem. ...
I would suggest looking at Bayesian probabilities. Then just monitor the chat room for a period of time to create your probability tree.
What’s the best way to capitalise the first letter of each word in a string in SQL Server.
|sql|sql-server|string|
What’s the best way to capitalise the first letter of each word in a string in SQL Server.
I think you can look at the code for [Kooky][1], and IIRC it also uses Markov Chains. Also check out the [kooky quotes][2], they were featured on Coding Horror not long ago and some are hilarious. [1]: http://kookybot.org/ [2]: http://quotes.kookybot.org/top
What's the best Django search app?
|python|django|search|search-engine|
I'm building a Django project that needs search functionality, and until there's a `django.contrib.search`, I have to choose a search app. So, which is the best? By "best" I mean... - easy to install / set up - has a Django- or at least Python-friendly API - can perform reasonably complex searches Here ar...
|svn|tortoisesvn|
History of changes to a particular line of code in Subversion?
|subversion|
Is it possible to see the history of changes to a particular line of code in a Subversion repository? I'd like, for instance, to be able to see when a particular statement was added or when that statement was changed, even if its line number is not the same anymore.
|svn|
Changing the Directory Structure in Subversion
|branch|subversion|
How do I create a branch in subversion that is deeper than just the 'branches' directory? I have the standard 'trunk', 'tags' and 'branches' structure and I want to create a branch that is several directories deeper than the 'branches' tag. Using the standard svn move method, it gives me a 'folder not found' erro...