examples

Difference between string and StringBuilder

I'd like to know the difference between string and StringBuilder and also need some examples for understanding. ...

Example complex XML file?

I would like to test something and for it I need a complex XML file of decent size(few hundred kilobytes at least). Does anyone know where I can get such a file? Everything I've seen on the internet is short and simple examples. By "complex" I mean I also want some form of relationships and nesting between elements of the file. ...

Python Nose Import Error

I can't seem to get the nose testing framework to recognize modules beneath my test script in the file structure. I've set up the simplest example that demonstrates the problem. I'll explain it below. Here's the the package file structure: ./__init__.py ./foo.py ./tests ./__init__.py ./test_foo.py foo.py contains: def dumb_tr...

Is there a public site to make and share live examples of C#/.NET code?

For instance, we now have that in the StackExchange universe for SQL Azure (which handles general SQL examples very well). I was thinking it would be very nice to have a similar environment to be able to have a few class files and a console program to be able to demonstrate core basic C#/.NET programming techniques - live. Is there suc...

The importance of using === instead of == in php!

Today only I have noticed and found out the importance of using === operator. You can see it in the following example: $var=0; if ($var==false) echo "true"; else echo "false"; //prints true $var=false; if ($var==false) echo "true"; else echo "false"; //prints true $var=0; if ($var===false) echo "true"; else echo "false"; //prints fal...

Using Java and IText, how to extract AcroForm field names from a PDF?

I'm looking for a simple API example, that reads a PDF file / template as an input, and iterates over the fields defined in the PDF form (I think it is called AcroForm) ...

Looking for some great example web applications to learn real-world development techniques

I've done a bunch of web development with JSP/J2EE and some ASP.NET. Nevertheless, I still feel like I'm catching up with the web 2.0 stuff that relies heavily on JavaScript. I have two questions: I'm looking for great samples of web applications to learn development techniques. I prefer to look at real-world examples (i.e. someth...

Would like to see example "HTML Snippet" from Google Adsense API

Google Adsnse has an API that you can use (if you qualify) to generate Adsense ads on your site. The core feature is the function generateAdCode that returns "an HTML snippet that can be dropped into an HTML page for the page to start receiving Google Ads." Try as hard as I could, I couldn't find a basic example of what that returned "...

Is it possible to generate an example string based on a regex pattern?

Dear reader, In my application the user can enter his own regex pattern into a text box so he can force a certain input for another user/text box. Is it possible for the user to see an example of a string that would match the regex he has entered? For example if he was to enter: ^[A-Z]{2}$, it would generate a string like "XX" to show t...

looking for (N) steps GUI kind of thing

i dont sure if this question is for this group but i don't know where to ask im looking for GUI examples that gives the user for example make X in 4 steps kind of GUI especial for none teachi folks ...

example.com is OK for domain example, what is example IP Address?

We use the example.com often for domain name reference. I wonder if any IP address used as an example IP address to mention in references like tutorial or notes?. I knew the loop back interface 127.0.0.1 can be used but it has been known for local system always. Can example.com IP Address used for this purpose legally? ...

Best way to implement call flow with Jain-Sip.

Hi, I was looking into my code, and I wonder how would the SIP call flow would be best implemented /controlled using Jain-SIP, I have designed my SIP call flow to be handled entirely sightlessly by my own code, which I assume is not the right way to do things, so I wanted to see some implementation using the Jain-SIP dialog and transact...

How to use RTF export feature of KDE?

In stackoverflow.com I have found a question where a user was suggesting to use this libraries of KDE in order to export-inport RTF files. But, when I downloaded I saw that there are lot of files that are included in the .cc and .h files that are missing. So please give a hint how to download all necessary files and is there any guide th...

Reading after "Java Concurrency In Practice" for more concurrency examples?

Many people at SO adviced to dive into Java concurrency by reading Java Concurrency in Practice (JCIP), sometimes Doug Lea's book of 1999 is mentioned as well: http://stackoverflow.com/questions/1237980/java-5-concurrency-book-recommendations http://stackoverflow.com/questions/452391/recommended-books-on-concurrency-synchronization-mec...

Proxy examples using org.apache.mina.proxy?

Does anyone know of any examples, ideally HTTP proxy, using the org.apache.mina.proxy package? ...

Rich WPF FocusVisualStyle.

Does anyone have a rich FocusVisualStyle to share? I am looking for something like the Silverlight 4 one or Google TextBoxes in Chrome or like Visual Studio 2010. Examples: ...

Custom application code examples for Sharepoint 2010 (or 2007)

As we all know there's a great learn-by-example application built specifically for Asp.net MVC developers. So they can check out the code and see for themselves how things are done. I wonder if there's anything similar that you know of but is intended at Sharepoint 2010 developers? Or even Sharepoint 2010 + Silverlight developers? It wo...

Public facing complex business apps on Sharepoint 2010 (or 2007)

I would like to see some public-facing sites or complex business applications built on top of SHarepoint 2010 (or at least 2007). They can either use Sharepoint's look'n'feel or have a completely custom one. If they're using Silverlight in heavy doses even better. ...

Java concurrency in practice - Listing 14.9 explanation?

Few listings from JCIP already appeared here. Here is one more (orig. code): public class ThreadGate { private boolean isOpen; private int generation; public synchronized void close() { isOpen = false; } public synchronized void open() { ++generation; isOpen = true; notifyAll(); ...

Example of UUID generation in c++

Hi everyone, I'm quite a newbie in c++ and I want to generate just random UUID's, as it is just important for instances in my program to have unique identifiers. I looked into Boost UUID, but I can't manage to generate the UUID because I don't understand which class and method to use. In Java it is as simple as java.util.UUID.randomUU...