instruction
stringlengths
0
30k
I did exactly what you're looking for using [Safari AdBlock][1]. Just define a few rules in Safari->Preferences->AdBlock and you should be good to go! [1]: http://safariadblock.sourceforge.net/
Whilst it is possible to correctly guess where your code needs testing, I generally think you need metrics to back up this guess. Unit testing in my view goes hand in hand with code-coverage metrics. Code with lots of tests but a small coverage hasn't been well tested. That said, code with 100% coverage but not te...
If you're looking to access SQLite databases on the browser (ie. client side) you'll need your browser to support it. You can do it with SpiderApe http://spiderape.sourceforge.net/plugins/sqlite/ which assumes that browser is Mozilla based (ie. with SQLite support). You'll still need to allow access to the underlying l...
If you want to customize message processing, consider implementing IMessageFilter, then call Application.AddMessageFilter to tell the standard message pump to call your filter function.
If you are using the `Tooltip` control on the form, you can do it like this: `ToolTip1.Show("Text to display", Control)` The <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.tooltip.show.aspx">MSDN documentation for the ToolTip control's "Show" method</a> has all the different variations on t...
Yes I have, mostly to do some things that resemble duck-typing when I was wrapping a legacy API in a more modern C++ interface.
You can run Rational Robot from the command line, so you should be able to set up a scheduled task to run a .BAT file to do this for you. The command is something like: [path to Rational Robot]\rtrobo [script file] /user "user name" /project [project file] /play /build "build name" /nolog /close The Robot documen...
An SOA design includes components (i.e., _services_) that can be used by code regardless of implementation (i.e., any OS or langauge). A single instance of a service may also be used by multiple applications, whereas, e.g., a DLL would have to be duplicated for each app and require the same implementation technology a...
As Martin Fowler says, it means different things to different people. His article on the topic is pretty good although it isn't quite a definition. http://martinfowler.com/bliki/ServiceOrientedAmbiguity.html It may explain, the difficulty coming up with a concrete definition.
SQL Recursion
|sql|mysql|
i have the next tables. *groups* table which contains hierarchically ordered groups and *group_member* which stores to which groups a user belongs to. groups --------- id parent_id name group_member --------- id group_id user_id ID PARENT_ID NAME ---...
I think you're confusing concepts here. The `ReadOnlyCollection` provides a read-only wrapper for an existing collection, allowing you (Class A) to pass out a reference to the collection safe in the knowledge that the caller (Class B) cannot modify the collection (i.e. cannot **add** or **remove** any elements from ...
Is there an Unobtrusive Captcha for web forms?
|security|usability|
What is the best unobtrusive CAPTCHA for web forms? One that does not involve a UI, rather a non-UI Turing test.
What is the best unobtrusive CAPTCHA for web forms? One that does not involve a UI, rather a non-UI Turing test. I have seen a simple example of a non UI CAPTCHA like the [Nobot][1] control from Microsoft. [1]: http://www.asp.net/AJAX/AjaxControlToolkit/Samples/NoBot/NoBot.aspx
What is the best unobtrusive CAPTCHA for web forms? One that does not involve a UI, rather a non-UI Turing test. I have seen a simple example of a non UI CAPTCHA like the [Nobot][1] control from Microsoft. I am looking for a CAPTCHA that does not ask the user any question in any form. No riddles, no what's in this ima...
|security|usability|captcha|
I'm not sure there's any value in telling users how long it took for the server to render the page. It could well be worth you logging that sort of information, but they don't care. If it takes the server 0.001 of a second to draw the page but it takes 17 seconds for them to load it (due to network, javascript, pag...
You might want to take a look at <a href="http://en.wikipedia.org/wiki/WBXML">wbxml</a> (Wireless Binary XML) it is optimized for size, and often used on mobile phones, but it is not optimized for parsing speed.
Loads, stick `string.Format` into Google :-) A quite good tutorial is at <a href="http://idunno.org/archive/2004/14/01/122.aspx">http://idunno.org/archive/2004/14/01/122.aspx</a>
As Keith said above. The most common one I use is currency: String.Format("{0:c}", 12000); Which would output £12,000.00
Yes, you could format it this way: string.Format("Format number to: {0 : #.00}", number); string.Format("Format date to: {0 : MM/dd/yyyy}", date);
Also to consider: in debug mode, the variables are initialized with 0xCCCCCCCC instead of zero. That might have some nasty side effects.
Make sure your project is set to target 3.5, and not 2.0. As others have said, your 'var' test is a test of C#3 (i.e. VS2008), not the 3.5 framework. If you set the project framework target settings properly, you should not expect to need to manually add dll references at this point.
There are a number. This [MS site is probably the best place to look][1] [1]: http://msdn.microsoft.com/en-us/library/dwhawy9k.aspx
Microsoft's own .NET based [XNA](http://creators.xna.com/) allows you to create networked games on Windows and XBox 360.
This is probably overkill, but you could also invoke script on the WebBrowser control and then use the scroll properties of the body tag. Or the scrollTo method of the window. To invoke script, the WebBrowser control has a Document property that represents the document object from the DOM. It has a method called Inv...
concatenating unknown-length strings in COBOL
|string|cobol|
How do I concatenate together two strings, of unknown length, in COBOL? So for example: WORKING-STORAGE. FIRST-NAME PIC X(15) VALUE SPACES. LAST-NAME PIC X(15) VALUE SPACES. FULL-NAME PIC X(31) VALUE SPACES. If FIRST-NAME = 'JOHN ' (trailing spaces), and LAST-NA...
How do I concatenate together two strings, of unknown length, in COBOL? So for example: WORKING-STORAGE. FIRST-NAME PIC X(15) VALUE SPACES. LAST-NAME PIC X(15) VALUE SPACES. FULL-NAME PIC X(31) VALUE SPACES. If FIRST-NAME = 'JOHNbbbbbbbbbbb' (where 'b' signifies a space),...
@Matt, You can still use the HttpWebRequest, then direct the response you receive to the actual outputstream response, this would serve the response back to the user. The only issue is that any relative urls would be broken. Still, that may work.
for (Map.Entry<String, String> entry : map.entrySet()) { System.out.println(entry.getKey() + "/" + entry.getValue()); }
Is this the proper use of a mutex?
|c#|mutex|
I have a situation where I might have multiple instances of a program running at once, and it's important that just one specific function not be executing in more than one of these instances at once. Is this the proper way to use a mutex to prevent this from happening? lock (this.GetType()) { _log.In...
I've never seen labels used "in the wild" in Java code. If you really want to break across nested loops, see if you can refactor your method so that an early return statement does what you want. Technically, I guess there's not much difference between an early return and a label. Practically, though, almost every Ja...
You need to manually free strings only when you manually allocate the memory yourself using "malloc" or "new" operators. If you do not use either of them then the char* or string will be created on the stack or as a compile-time constant.
No. You only need to manually free strings when you manually allocate the memory yourself using "malloc" or "new" operators. If you do not use malloc or new, then the char* or string will be created on the stack or as a compile-time constant.
using DBMS_APPLICATION_INFO with Jboss
|java|oracle-database|jboss|
Does anyone have examples of how to use [DBMS_APPLICATION_INFO][1] package with JBOSS? We have a various applications which run within JBOSS and share db pools. I would like, at the start of each session these applications to identify themselves to the database using DBMS_APPLICATION_INFO so I can more easily trac...
LOB/CLOB column may not be large enough. Hibernate has some default column sizes for LOB/CLOB that are relatively small (may depend on db). Anyway, try something like this: @Lob @Column(length=2147483648) Adjust the length (in bytes) based on your needs.
Java Web Services API, however I can't run Tomcat on my server
|web-services|json|
I'm trying to use some data from a PlanPlusOnline account. They only provide a java web services API. The server for the site where the data will be used does not allow me to install Tomcat. I'm not going to lie, I am a Java software engineer, and I do some web work on the side. I'm not familiar with web services o...
Java Web Services API, however I can't run a JVM on my server
I'm trying to use some data from a PlanPlusOnline account. They only provide a java web services API. The server for the site where the data will be used does not allow me to install Tomcat (edit: or a JVM for that matter). I'm not going to lie, I am a Java software engineer, and I do some web work on the side. I'm...
One of the other teams where I work is working on a Flex-based drawing application and they were totally surprised that AIR / Flex does not have PDF authoring built-in. They ended up rolling their own simple PDF creator based on the PDF specification.
|java|editor|presentations|
Favorite (G)Vim plugins/scripts?
|editor|vimtips|
What are your favorite (G)Vim plugins/scripts?
|editor|vim|vimtips|
|editor|vim|
|vim|editor|
Why are there so few modal-editors that aren't vi*?
|editor|vim|
Pretty much every other editor that isn't a vi descendant (vim, cream, vi-emu) seems to use the emacs shortcuts (ctrl+w to delete back a word and so on)
|editor|vim|vi|
|vim|editor|vi|
Use cases for regular expression find/replace
|regex|editor|
I recently discussed editors with a co-worker. He uses one of the less popular editors and I use another (I won't say which ones since it's not relevant and I want to avoid an editor flame war). I was saying that I didn't like his editor as much because it doesn't let you do find/replace with regular expressions. ...
|regex|editor|
What is the easiest-to-use web "rich text editor"
|html|editor|
I am looking for a text editor to be used in a web page. Where users can format the text and get a WYSIWYG experience. Doesn't need to be too fancy. But has to be easy to use and integrate into the page. Has to generate HTML as output. Support AJAX (one I checked works only with standard form submit) and has to be smal...
Native Tongue as Default Language For an Application
|user-interface|language|user-experience|
When downloading both Firefox and Chrome, I've noticed that the default version I got was in my native tongue of Hebrew. I personally don't like my applications in Hebrew, since I'm used to the English UI conventions embedded in me since long ago by: 1. **The lack of choice:** Most programs don't offer interfaces i...
I'd go with: > Defining a series of stateless, client > agnostic business operations created > to be leveraged in multiple > applications.
That's a well known error message: http://staceyw.spaces.live.com/blog/cns!F4A38E96E598161E!1042.entry Basically you just need to put a cast in front of your anonymous delegate (your lambda expression).
boost has a strong split function: [boost::algorithm::split][1] [1]: http://www.boost.org/doc/libs/1_36_0/doc/html/boost/algorithm/split_id2965593.html
I agree with mweerden. Trying something I believe is similar to your code, I get: (gdb) print cwd $1 = "/media", '\0' <repeats 782 times>, "\016���" ... (gdb) print (char*) cwd $2 = 0xbfc8eb84 "/media" from gdb, so it seems that since `cwd` was defined as `char cwd[3500]`, gdb prints the entire...
I've never written an application for use by a large number of people, and never for anyone that didn't use English as their language, but if I did, I would probably take a route that installs all available language packs at install (unless the user did a custom install, where I would allow them to choose language pack...
HTML to Markdown with Java
|java|markdown|
is there an easy way to transform HTML into markdown with JAVA? I am currently using the Java **MarkdownJ** library to transform markdown to html. import com.petebevin.markdown.MarkdownProcessor; ... public static String getHTML(String markdown) { MarkdownProcessor markdown_processor = ne...
The answer depends on the particular component you're using. Contact your component help desk OR read up the documentation on what it takes to deploy their component. Basically component developers are free to implement licensing **as they deem fit**. With the .licx file the component needs to be able to do whatev...
Killing Excel.EXE on server
|asp.net|excel|
Suppose a ASP.NET web application generates automated Excel Reports on the server. How do we kill a server-side Excel.EXE once the processing is over. I am raising this purposely, because I believe that the Garbage Collecter does not clean the Excel executable even after the Excel file is closed. Any pointers would ...
Bestpractice for Java IPC
|java|multithreading|
what is the best method for inter process communication in a multithreaded java app. It should be performant (so no JMS please) easy to implement and reliable,so that objects & data can be bound to one thread only? Any ideas welcome! Thanks Okami
Best practice for Java IPC
|java|multithreading|
How do you show events in UML Class Diagrams?
|uml|visio|
This one has me stumped regularly while creating top level class diagrams for documentation. Methods and attributes/fields are easy to model. I usually end up adding a method named EvChanged to indicate a .Net event Changed. What is the right way to show that a type publishes a specific event?
I use PyBlosxom for my personal blog, and I think it is pretty useful if you need something minimalistic. The deployment is simple, as you need only the python runtime and cgi. You might want to have some basic knowledge of python at least if you are going to use it, though. > Have a look at Blosxom. It's file-based...
The command you need is "taskkill". http://technet.microsoft.com/en-us/library/bb491009.aspx > taskkill excel.exe
Are you using VSTO? You can close the Excel app after you finished with `excelobject.Quit();` It worked for me, but I don't use Excel on server-side anymore. You can have a look on Excel's XML schema to build the Excel file without Excel itself. Check out [CarlosAg Excel Writer][1], which does exactly the same. ...
Yes, I am attempting to use the attribute free serialization that was announced as part of SP1 (http://www.pluralsight.com/community/blogs/aaron/archive/2008/05/13/50934.aspx). Damned if I can get it to work and there's no documentation for it.
The other alternative might be a code generator such as codesmith to automate creating the properties. This would be especially useful if the properties you are creating are columns in a database table
If you like the functional style, you can try something like string ids = "1,2,3,4,5"; List<int> l = new List<int>(Array.ConvertAll( ids.Split(','), new Converter<string, int>(int.Parse))); No lambdas, but you do have Converters and Predicates and other nice things that can be ma...
It *should* work; however if you have 3.5SP1 on one machine and 3.5 or less on another there was an (unannounced) breaking change with the code to generate the unique ID from the card; which may explain why it doesn't work. I would try sending a test transaction to [the SharpSTS test page][1] with only the PPID as t...