instruction stringlengths 0 30k ⌀ |
|---|
Here's an article that discusses various webscrapers that will generate feeds: http://www.masternewmedia.org/news/2006/03/09/how_to_create_a_rss.htm
If you don't care to click through, here are the services the author discusses:
* http://www.feedyes.com/
* http://www.feed43.com/
* http://www.feedfire.com/site/i... |
The `this` likely refers to the rokbox instance; I don't think you need to worry about it, you're interested in the code that runs on the click event. The salient part looks to be the following:
self.swtch=false;
self.close(e);
`self` most likely refers to the rokbox instance, again, so assuming you inst... |
Not exactly what you ask for, but I've found it easier to just all agree on a coding standard [astyle][1] can generate and then automate the process.
[1]: http://astyle.sourceforge.net/ |
Set the ControlBox property of the form to False, and the Text property to empty string. The form will open with no perceivable (to the user) title bar, but they will be able to resize the form. |
FWIW: I use
html { height: 101%; }
to force scrollbars to always appear in Firefox. |
Setup a class like:
public delegate void InstantiateTemplateDelegate(Control container);
public class GenericTemplateImplementation : ITemplate
{
private InstantiateTemplateDelegate instantiateTemplate;
public void InstantiateIn(Control container)
{
this.instantiateTemplate(container);
}
... |
Apparently, I needed to run openssl as root in order for it to have permission to the seeding file. |
I don't know if this is a good idea in terms of resource usage and "best practices" and "cleanliness" and all the rest... but you have now repeatedly described the handcuffs that bind you in terms of re-architecting a "clean" system... so here goes.....
Could you open a new, separate connection just for sending the ... |
Regarding the question "is the internet connection permanent or not?":
* best way would be probably to make the app robust enough to _always_ cope with a non-permanent connection :-) which would work the same with dialup and broadband...
* alternatively, maybe you can find out how long the user's internet connectio... |
These are macros that give hints to the compiler about which way a branch may go. The macros expand to GCC specific extensions, if they're available.
GCC uses these to to optimize for branch prediction. For example, if you have something like the following
if (unlikely(x)) {
dosomething();
}
... |
Creating a shiny Graphic/Gloss Effect |
|.net|image|web2.0| |
I would like to programmatically create a gloss effect on an Image, kinda like on the Apple-inspired design that the Web has adopted when it was updated to 2.0 Beta.
Essentially this:
![example icons][1]
Now, I see two approaches here: I create one image which has an Alpha channel with the gloss effect, and th... |
I think the most important question is, "Why are you doing it (the CMS, not the web site)?" This is very well-trod ground. Unless you have some really innovative ideas and unique insights into how you want it to be done ... and your question suggests that you probably don't ... you would probably be better-served by ... |
How to setup Trac to run at / with Lighttpd on a subdomain |
|trac|lighttpd|fastcgi| |
I have the following config in my lighttpd.conf:
$HTTP["host"] == "trac.domain.tld" {
server.document-root = "/usr/home/daniels/trac/htdocs/"
fastcgi.server = ( "/trac" =>
( "trac" =>
( "socket" => "/tmp/trac-fastcgi.so... |
If you're using FastMM4 as your Memory Manager, you can check that the class is not **TFreeObject**.
Or, in a more standard case, use a routine that will verify that your object is what it says it is by **checking the class VMT**.
There have been such ValidateObj functions hannging around for some time (by Ray Li... |
For small sites, it doesn't make a bit of a difference.
As the load grows, though, this scales really badly, and quicker than you think:
- Database servers are built on the premise they "own" the server. They trade memory for speed and they easily use all available RAM for internal caching.
- Once resources star... |
Way too many organizations in the USA use SSNs as unique identifiers for people, despite the well-documented problems with them. Unless your application actually has something to do with government benefits, there's no good reason for you to store SSns.
Given that so many organizations (mis)use them to identify peop... |
Another vote for [mozy.com][1]
You get 2gb for free, or for $5/month gives you unlimited backup space. Backups can occur on a timed basis, or when your PC/Mac is not busy. It's encrypted during transit and storage.
You can retrieve files via built in software, through the web or pay for a DVD to be burned and pos... |
Eventually I got it working again. By deploying to a different folder and recreating the virtual folder / application to it.
I am not sure how that makes a difference but at least things are working again. |
If you want to have the data source to always be on the safe side of concurrency, you should have at least one pointer that is always safe for him to use.
So the Observer object should have a lifetime that isn't ended before that of the data source.
This can be done by only adding Observers, but never removing the... |
I would just increase the available memory.. Try adding -Xmx256m -Xmx256m to your VM. |
Nowadays I would just start with a distributed system. They are easier to set up (you don't need to set up a server and/or find one on-line: just `init` some random directory and start doing your stuff) and just as easy/hard to understand as the centralized ones.
Here are a few that people should take a look when ch... |
thanks to Arachnid for the answer - it worked as suggested
here is a simplified copy of the code, in case it is helpful to the next person to try!
import os
import urllib
import urllib2
import cookielib
users_email_address = "billy.bob@gmail.com"
users_password = "billybob... |
Hope I don't get down-modded for recommending a program I wrote, but how about tree? tree -l will follow symlinks. You may already have it, but you can download it here:
http://mama.indstate.edu/users/ice/tree/
|
Don't blame the GU, it's my fault. That method has been moved to MvcFutures. Here's a [blog post that provides the foundation for why this change was made][1].
[1]: http://haacked.com/archive/2008/08/29/how-a-method-becomes-an-action.aspx |
All good points, the ones made here. You will also have to deal with dynamically-generated Java and JavaScript links, parameters and session IDs, escaping single and double quotes, failed attempts at relative links (using ../../ to go past the root directory), case sensitivity, frames, redirects, cookies....
I coul... |
An HTML document is considered a flow, think of a stack of HTML elements piled up to the top.
A block is defined in the flow as a box (by default as large as the page) and is pushed as much as possible to the top without overlapping another block. Examples: div, p, table.
An inline element does not define a box (... |
There is an assembly instruction called BSWAP that will do the swap for you, *extremely fast*.
You can read about it [here][1].
Visual Studio, or more precisely the Visual C++ runtime library, has platform intrinsics for this, called `_byteswap_ushort(), _byteswap_ulong(), and _byteswap_int64()`. Similar should exi... |
"Is there an event that's called everytime a page is loaded?"
Page_Load might be what you're looking for.
However, and I'm really not trying to be mean here, if you don't know that, you probably shouldn't be trying to secure the app. You're just not experienced enough in .Net
I'm sure you're great at what you... |
They increase performance for collections using value types, since no boxing/unboxing will be required. They're a lot cleaner to use since you won't have to cast an object (for example using ArrayList) to the desired type - and likewise they help enforce type safety. |
Real motiviation comes from within. Some people will game the system every chance they get sometimes for no other reason than they can. Others do it simply because they are hacks.
That said, assuming your the manager, have a "come to jesus" meeting with the dev. If that still doesn't work, there's always the door... |
I don't think there is a function that does that by itself, but it wouldn't be too hard to write a function in a loop that used the "partition" (check amount of spaces, loop for each space and add first two elements of return from partition to an array, then work on the third element until no spaces left)
Or you cou... |
I don't think there is a function in the standard library that does that by itself, but "partition" comes close
The best way is probably to use regular expressions (which is how I'd do this in any language!)
import re
print re.split(r"(\s+)", "Your string here")
|
Rethrowing the same exception is useful if you want to, say, log the exception, but not handle it.
Throwing a new exception that wraps the caught exception is good for abstraction. e.g., your library uses a third-party library that throws an exception that the clients of your library shouldn't know about. In that ca... |
Generally the "Do Something" either involves better explaining the exception (For instance, wrapping it in another exception), or tracing information through a certain source.
Another possibility is if the exception type is not enough information to know if an exception needs to be caught, in which case catching it ... |
I think it depends on what you are trying to do with the exception.
One good reason would be to log the error first in the catch, and then throw it up to the UI to generate a friendly error message with the option to see a more "advanced/detailed" view of the error, which contains the original error.
Another appr... |
As you specifically asked for collections, I'd like to add an aspect that the other answers haven't mentioned yet: A HashMap doesn't expect their keys to change their hashcode once they are added to the collection. Would defeat the whole purpose... |
If I understand your question correctly, you have a custom collection class (i.e. a new class that extends from the Collection interface) and you want to implement the hashCode() method.
If your collection class extends AbstractList, then you don't have to worry about it, there is already an implementation of equals... |
Defining objects when using Jaxer |
|javascript|oop|aptana|jaxer| |
I've been playing with [Jaxer][1] and while the concept is very cool I cannot figure out how to define objects that are available on both the client and the server. None of the examples I can find define objects at all.
**I'd like to be able to define an object and specify which methods will be available on the serv... |
IF EXISTS (SELECT * FROM [Table] WHERE Id = X)
UPDATE [Table] SET...
ELSE
INSERT INTO [Table] |
IF EXISTS (SELECT * FROM [Table] WHERE ID = rowID)
UPDATE [Table] SET propertyOne = propOne, property2 . . .
ELSE
INSERT INTO [Table](propOne, propTwo . . .) |
IF EXISTS (SELECT * FROM [Table] WHERE ID = rowID)
UPDATE [Table] SET propertyOne = propOne, property2 . . .
ELSE
INSERT INTO [Table] (propOne, propTwo . . .)
**Edit:**
Alas, even to my own detriment, I must admit the solutions that do this w/o a select seem to be better since they accomplish... |
What version of ar_mailer are you using? A gmail specific bug was fixed in 1.3.1, as shown here:
http://rubyforge.org/forum/forum.php?forum_id=16364
|
The Microsoft Learning website has a useful introduction, which I believe is available free if you have a Microsoft Passport account <https://www.microsoftelearning.com/eLearning/courseDetail.aspx?courseId=85488> |
Personally, I would avoid server-side frameworks that try to embed or hide the client-side framework. I'm sure that GWT is great for getting something going quickly, and is probably fine for certain kinds of applications, but you'll probably run into lots of problems "on the edges" for more complex applications. Deco... |
thanks to Arachnid for the answer - it worked as suggested
here is a simplified copy of the code, in case it is helpful to the next person to try!
import os
import urllib
import urllib2
import cookielib
users_email_address = "billy.bob@gmail.com"
users_password = "billybob... |
Did you try JFGI?
Setting up Ant task that could do the work for you?
This blog post details how to setup targets that can start and stop jetty for you. You could easily cobble together another target called 'jetty-restart' which depends on 'jetty-stop' and then calls 'jetty-start'.
http://ptrthomas.wordpress.co... |
MicroATX is pretty much a standard PC motherboard format, most capable of 4-8GB of RAM. I'f you're talking picoATX maybe you're limited to 1-2GB ram. Even them that's plenty for a development environment. I'd still stick with UTF-8 for reasons mentioned above, but memory shouldn't be your concern. |
Write a launcher program to run your program and report abnormal exit code to the user. |
To get the current directory, you can use this:
CD > tmpFile
SET /p myvar= < tmpFile
DEL tmpFile
echo test: %myvar%
It's using a temp-file though, so it's not the most pretty, but it certainly works! 'CD' puts the current directory in 'tmpFile', 'SET' loads the content of tmpFile.
Here is a ... |
You can capture all output in one variable, but the lines will be separated by a character of your choice (# in the example below) instead of an actual CR-LF.
@echo off
setlocal EnableDelayedExpansion
for /f "delims=" %%i in ('dir /b') do (
if "!DIR!"=="" (set DIR=%%i) else (set DIR=!DIR!#%%i)... |
You can capture all output in one variable, but the lines will be separated by a character of your choice (# in the example below) instead of an actual CR-LF.
@echo off
setlocal EnableDelayedExpansion
for /f "delims=" %%i in ('dir /b') do (
if "!DIR!"=="" (set DIR=%%i) else (set DIR=!DIR!#%%i)... |
I'm not aware of any readily available library or class that does this. This may mainly be because I don't care as I am on the side of strongly opposing such tests. So even though you asked there *must* be a bit of justification for this view:
I doubt that autotesting getters and setters benefit your code quality or... |
How do I convert between big-endian and little-endian values in C++? |
|c++|c|endian| |
How do I convert between big-endian and little-endian values in C++? |
How do I convert between big-endian and little-endian values in C++?
EDIT: For clarity, I have to translate binary data (double-precision floating point values and 32-bit and 64-bit integers) from one CPU architecture to another. This doesn't involve networking, so ntoh() and similar functions won't work here.
E... |
To make a column editable you have to override the isCellEditable method in the TableModel. Creating a TableModel is fairly easy if you inherit AbstractTableModel and I'd recommend it for all but the most simple JTables.
However, adapting the TableModel is only part of what you need to do. To actually get a custom c... |
Java hashmap vs hashtable |
|java|hashtable|hashmap| |
What is the difference between a hashmap and a hashtable in Java, and which is more efficient for non-threaded applications? |
|java|hashtable|hash-map| |
|java|hashmap|hashtable| |
I think you've almost answered the question for yourself there. If you have someone work for you or with you (you're not clear no whether you are this dev's manager) then if they are not doing the job properly then surely there are procedures that are available to make it clear to this person that they are not producin... |
How do you store/share online your personal documents ? |
|personal|storage|documents|sharing| |
For photos, I use Flickr. But for other documents...Which web based online application (hosted or to install on your personal web site) do you use for PDF or word files ? If there is a user management it would be also great (for example you decide that some persons, or everyone, can see some of your documents...). |
If you're using Visual C++ do the following: You include intrin.h and call the following functions:
For 16 bit numbers:
unsigned short _byteswap_ushort(unsigned short value))
For 32 bit numbers:
unsigned long _byteswap_ulong(unsigned long value))
For 64 bit numbers:
unsigned __int64 _b... |
How to render unicode characters in the correct font? (C#/WinForms) |
|c#|winforms|unicode|rendering| |
My application correctly handles different kind of character sets, but only internally - when it comes to displaying text in standard WinForms labels und textboxes, it seems to have problems with chinese characters.
The problem seems to be the font used (Tahoma), because when I copy&paste the text, or view it in the... |
My vote is- mostly you can just avoid them :)
The main advantage for generics is to save casting, if you end up doing casting internally that doesn't make any sense. If you try to look into this issue you would found that mostly the candidates for generics are really those collections/sets which could create native... |
My vote is- mostly you can just avoid them :)
The main advantage for generics is to save casting, if you end up doing casting internally that doesn't make any sense. If you try to look into this issue you would found that mostly the candidates for generics are really those collections/sets which could create native... |
My vote is- mostly you can just avoid them :)
The main advantage for generics is to save casting, if you end up doing casting internally that doesn't make any sense. If you try to look into this issue you would found that mostly the candidates for generics are really those collections/sets which could create native... |
Can I compose a Spring Configuration File from smaller ones? |
|java|spring| |
I have a handful of projects that all use one project for the data model. Each of these projects has its own applicationContext.xml file with a bunch of repetitive data stuff within it.
I'd like to have a modelContext.xml file and another for my ui.xml, etc.
Can I do this? |
The best explanation I ever saw of a closure was to explain the mechanism. It went something like this:
Imagine your program stack as a degenerate tree where each node has only one child and the single leaf node is the context of your currently executing procedure.
Now relax the constraint that each node can hav... |
yeah except /<tag[^>]*>.*?<\/tag>/
Will not match a single tag, but match the first start-tag and the last end-tag for a given tag. Just like your first non-greedy tag-match, your in-between should be written non-greedy as well. |
see if you get the same result using &gt; instead of > |
I have to think that wanting to serialize an exception is a strong indication that you're taking the wrong approach to something. What's the ultimate goal, here? If you're passing the exception between two processes, or between separate runs of the same process, then most of the properties of the exception aren't going... |
[getpass](http://docs.python.org/lib/module-getpass.html) is useful for determining the login name of the current user.
[grp](http://docs.python.org/lib/module-grp.html) allows you to lookup Unix group IDs by name, and vice versa.
[dircache](http://docs.python.org/lib/module-dircache.html) might be useful in situ... |
Yeah, you can do RenderPartial. That's a good start. But eventually these guys will need logic and other controllery type stuff. Be on the lookout for a subcontroller implementation from the framework team. There should also be something in MvcContrib soon. Or roll your own. |
In order to do that you would need either callbacks embedded in the regex (which AFAIK C# doesn't support) or preferably hooks into the regex engine. Even then, it's not clear what result you would want if backtracking was involved. |
If you're looking for the solution provided in [Using the result of a command as an argument in bash?](http://stackoverflow.com/questions/58207/using-the-result-of-a-command-as-an-argument-in-bash)
then here is the code:
@echo off
if not "%1"=="" goto get_basename_pwd
for /f "delims=X" %%i in ('cd')... |
Nuclear/particle physics here.
* Major programing work used to be done mostly in fortran using CERNLIB (PAW, MINUIT, ...) and GEANT3, recently it has mostly been done in C++ with ROOT and GEANT4. There are a number of other libraries and tools in specialied use, and Labview sees some use here and there.
* Data aqui... |
Nuclear/particle physics here.
* Major programing work used to be done mostly in fortran using CERNLIB (PAW, MINUIT, ...) and GEANT3, recently it has mostly been done in C++ with ROOT and GEANT4. There are a number of other libraries and tools in specialied use, and Labview sees some use here and there.
* Data aqui... |
It not only depends from the browser and version you choose, but also from the doctype of your html document. Internet explorer in "quirks mode" is for example completely different from Internet explorer with doctype XHTML 1.0 Transitional. |
THE MAIN REASON of re-throwing exceptions is to leave Call Stack untouched, so you can get more complete picture of what happens and calls sequence. |
FYI, this is a related question about each type of re-throw:
[http://stackoverflow.com/questions/6891/performance-considerations-for-throwing-exceptions#6978][1]
My question focuses on "Why" we re-throw exceptions and its usage in application exception handling strategy.
[1]: http://stackoverflow.com/questions/... |
Windows Performance Counter Port to Linux, HP-UX and AIX |
|performancecounter|linux|hp-ux|aix| |
We implemented a server application available on Windows only. Now we like to port it to Linux, HP-UX and AIX, too. This application provides internal statistics through performance counters into the Windows Performance Monitor.
What is the appropriate and commonly used performance monitor under Linux, HP-UX and AIX... |
|linux|aix|performancecounter|hp-ux| |
We implemented a server application available on Windows only. Now we like to port it to Linux, HP-UX and AIX, too. This application provides internal statistics through performance counters into the Windows Performance Monitor.
To be more precise: The application is a data base, and we like to provide information l... |