instruction
stringlengths
0
30k
Does anyone know how to generate WSDL from a Web Service in Ruby using Soap4R. I have a fairly simple Web Service (SOAP::RPC::StandaloneServer) and would like to consume from .NET . Thanks
Turn off inlining of functions. The easiest way to do this is to just compile in Debug mode.
Turn off inlining of functions. The easiest way to do this is to just compile in Debug mode. **Edit:** after seeing your clarification, I find my answer is in error. Perhaps if you moved the body of the function into another section of the .h file, using the "inline" keyword?
From [sagi shkedy's technical blog][1]: function generateGuid() { var result, i, j; result = ''; for(j=0; j<32; j++) { if( j == 8 || j == 12|| j == 16|| j == 20) result = result + '-'; i = Math.floor(Math.random()*16).toString(16).toUpperCase(); result ...
From [sagi shkedy's technical blog][1]: function generateGuid() { var result, i, j; result = ''; for(j=0; j<32; j++) { if( j == 8 || j == 12|| j == 16|| j == 20) result = result + '-'; i = Math.floor(Math.random()*16).toString(16).toUpperCase(); result ...
You should learn whatever you *want* to learn. If you don't you'll probably find it harder going than you need to. I personally started writing desktop applications for Windows, because I used it at the time. These days I do think that you're correct - you can produce a website / online-application without investi...
There will always be a market for native apps, although a lot of stuff is moving to the web and there's more scope than ever before for web based apps, native GUI applications are never going to go away entirely. However, it's really, really hard to give you any really useful advice other than **stick with what you ...
Non-web applications will be very useful for the far future (as I see right now). We will not be able to do anything with the efficiency as a well written desktop application online using an interpreted scripting language that has to use a network protocol to communicate with the client. However, if you are interest...
Thanks for your responses. I'll look into both of your suggestions. To A I Breveleri: yeah I know what your saying, I'm reluctant to switch them off, but the other App that uses the database is far more important than mine. Ideally I'd like the following to happen: My app starts getting data, if the other a...
When my daughter was about 6 or 7 years old I showed her Logo - should thought it was fun drawing the shapes - but then lost interest. When she was 10 I then tried **Squeak** - and she thought that was great. She quickly picked up on the Smalltalk syntax and her much fun. I also tried Greenfoot - but with less succe...
In my oppinion, a novice should conentrate on the basics and internals of the language of choice. Graphical or web interfaces should wait until you know what you're doing in the backend. I personally would suggest you start with console programs, but I guess that depends on the platform you're using. Maybe desktop inte...
How to send clean email messages from your application?
There are currently several competing proposals, [BGGA][1], [CICE][2], among others. Unfortunately, a heated debate remains over the best approach. As a result it is unlikely at this point that closures will make it into Java 7, due to the conservative nature of the acceptance process. The key problem here is that...
You need to configure the server daemon to only bind to localhost using the Listen directive like this: Listen 127.0.0.1 An alternative is to configure access control for the main server like this <Directory "/var/www/localhost/htdocs"> AllowOverride None Deny from all Allow from 127.0.0...
A firewall should be sufficient. Just make sure that you run apache in a non-standard port (typically 8080) and make sure your firewall blocks outside access to that port.
If you want something that is quick and easy to work with that integrates well with Windows I would suggest Microsoft Office Groove. I have been using it on my current project and it also easily allows you to start new projects and add members. It is not the best solution in the world, but it is included with Off...
Install a firewall and close all external ports but those who you want to use. If you are using Linux, there are nice frontends for iptables such as firestarter, if you use OS X there is an integrated firewall and Windows has one too. :) But yes, the Firewall is the way to go. (Or you can tell Apache to listen on ...
Performance implications of computed columns in SQL Server 2005 database?
|sql-server|performance|t-sql|database-design|calculated-columns|
The situation: we have a large database with a number of denormalized tables. We frequently have to resummarize the data to keep the summary tables in synch. We've talked on and off about using computed columns to keep the data fresh. We've also talked about triggers, but that's a separate discussion. In our summary...
It is difficult to implement a thorough sql injection/xss injection on a site that doesn't cause false alarms. In a CMS the end user might want to use <script> or <object> that links to items from another site. I recommend having all users install FireFox with NoScript ;-)
[AMF](http://en.wikipedia.org/wiki/Action_Message_Format) is a messaging protocol commonly used to talk between flash and a backend system. There're several Java implementations listed on the wikipedia that might do what you want. Flash can also talk plain old xml or rest to the backend, so depending on your codebase t...
[AMF](http://en.wikipedia.org/wiki/Action_Message_Format) is a messaging protocol commonly used to talk between flash and a backend system. There're several Java implementations, but I haven't used any of them so can't tell you which is best. * [Blaze DS](http://labs.adobe.com/technologies/blazeds/) * [Red5](http:/...
I just like them because they give you a quick way to define a custom type (as I use them anyway). So for example instead of defining a structure consisting of a string and an integer, and then having to implement a whole set of objects and methods on how to access an array of those structures and so forth, you can ...
Exceptions are intended for events that are abnormal behaviors, errors, failures, and such. Functional behavior, user error, etc., should be handled by program logic instead. Since a bad account or password is an expected part of the logic flow in a login routine, it should be able to handle those situations without ...
It's always pretty dodgy, especially if you're allocating resources inside a constructor; depending on your language the destructor won't get called, so you need to manually cleanup. It depends on how when an object's lifetime begins in your language. The only time I've really done it is when there's been a security...
The post above mentioning Devel::Prof probably really means [Devel::Cover][1] (to get the code coverage of a test suite). [1]: http://search.cpan.org/dist/Devel-Cover/lib/Devel/Cover.pm
I know of one smallish company that have sent a mail server product to the market. They had at least 2 people working full time on the project. Also, a major player in the IT business have several employees using D in larger internal projects. Further I know of one company seeking venture funding, several (at least 4) ...
|email|smtp|reverse-dns|spf|
When developing an application that sends out notification email messages, what are the best practices for 1. not getting flagged as a spammer by your hosting company. (Cover any of:) - best technique for not flooding a mail server - best mail server products, if you were to set up your own - sending mes...
I don't think it is ever a good idea to choose one side and stick with it religiously. I think a good engineer will expose himself to as much as he can so he can make an informed decision about which is the best tool to complete a task. In other words, don't choose a platform, OS, programming language, etc. and the...
GWT or DOJO or something else?
|javascript|web-applications|frameworks|gwt|dojo|
I come from the Microsoft world (and I come in peace). I want to rapidly prototype a web app and if it works out, take it live - and I don't want to use ASP.Net. I am not sure which web application toolkit to use though. Should I use GWT, DOJO...other recommendations? I am open to any server-side language but am lo...
I agree, you should learn what you want to. Once you have an understanding of Web, then learn some desktop programming to broaden your horizons a bit. You'll never know when you'll need it. But, also, if you're looking at learning windows desktop development, then you should definitely look at C# and/or VB.NET. The ...
Learning non-web applications will always be useful. There will always be applications that are not suited to be web apps. Even if _everything_ moved to be a web application, the server side code and web browsers still need to be written. At this point in time, if you're interested in the Windows platform then I...
Web development is all well and good but the majority of systems even if they have a nice web front end still consist primarily below the web level, a bit like an iceberg. End most web implementations are n-tier in design with the lower levels like data access and integration with peer servers ocurring in non web la...
What's the best way to make a mobile friendly site?
|mobile|
Speaking entirely in technology-free terms, what is the best way to make a mobile friendly site? That is, I want to make a site that will work on a regular computer but also have mobile versions of the pages. Should I rewrite each page? The pages will probably have different functionality, so should I rewrite the ba...
For projects using specific environment (like SharePoint object model)is recommended using virtual pc with installed in GAC assemblies. ADFS assemblies should have only Win server. If you find them and install manually in work environment (desktop) some possibilities (like debugging) will not impossible.
select * from table1 t1 inner join table2 t2 on t1.id = t2.resultid -- this could be a left join if the table is not guaranteed to have entries for t1.id inner join table2 t3 on t1.id = t3.resultid -- etc OR if the data is all in the same format you could do. select cola,colb from table1 where i...
SELECT * FROM table1 t1 INNER JOIN table2 t2 ON t1.id = t2.resultid -- this could be a left join if the table is not guaranteed to have entries for t1.id INNER JOIN table2 t3 ON t1.id = t3.resultid -- etc OR if the data is all in the same format you could do. SELECT cola,colb FROM table1 WHERE i...
Granting access to hundreds of SPs??
|sql-server|security|stored-procedures|automation|
In Sql Server 2000/2005, I have a few NT user groups that need to be granted access to hundreds of stored procedures. Is there a nice easy way to do that?
|sql-server|security|stored-procedures|
What happens if MySQL connections continually aren't closed on PHP pages?
|php|mysql|
At the beginning of each PHP page I open up the connection to MySQL, use it throughout the page and close it at the end of the page. However, I often redirect in the middle of the page to another page and so in those cases the connection does not be closed. I understand that this is not bad for performance of the web s...
Unless you've already written this and find you have a performance problem I wouldn't worry about which is quicker. Go with the one that's more readable. Remember, "Premature optimization is the root of all evil." - Donald Knuth
There are some things in XSLT 2.0 that aren't supported in the built in libraries (there was discussion on the mono mailing list about this but I can't find the information anymore). But most people never run into the corner cases that aren't supported. Another option is to check out the open source http://saxon.so...
I don't have a lot of experience with Subversion so please excuse me if this method doesn't work in this environment. In this situation I follow these steps: 1. Check out the file in question ready for editing as r4 2. Overwrite your local copy of the file with the revision you require, in this case r2 3. Ch...
For a manual migration (or to understand what happens) : * remove "read-only" attribute for all files * remove *.scc * remove *.vssscc * remove *.vspscc * delete *.suo * remove "SourceCodeControl..." section from your solution.sln file * remove "SccProjectName..." section from your projects.csproj files
C# string manipulation search and replace
|c#|regex|string|
I have a string which contain tags in the form < tag >. Is there an easy way for me to programmatically replace instances of these tags with special ascii characters? e.g. replace a tag like "< tab >" with the ascii equivelent of '/t'?
String comparison will always rely completely on the runtime environment (unless the strings are statically allocated, though the need to compare those to each other is debatable). Type comparison, however, can be done through dynamic or static binding, and either way it's more efficient for the runtime environment th...
I found this code to be useful. It does the detection and optional activation of an existing application: http://www.codeproject.com/KB/cs/cssingprocess.aspx
Editing Autogenerated DMBL file for WCF Service
|.net|linq-to-sql|wcf|dbml|
In our project have a standard auto-generated designer.cs file, linked to a DBML file, that contains all our object classes that map onto our database tables. We want to pass these objects directly through a WCF Service and so they need decorating with the [DataContract] and [DataMember] attributes where appropriate...
|.net|wcf|linq-to-sql|dbml|
It looks like the browser (Firefox in my case) has to be shutdown before the profiler is started. Step 1. in the livedocs even says this -- wish I had read it earlier. :) http://livedocs.adobe.com/flex/3/html/help.html?content=profiler_3.html
in the configuration file, change the LISTEN directive to only listen on the loop back address: Listen 127.0.0.1
I'm assuming you want to generate an image dynamicly based upon an url. What I typically do is a create a very lightweight HTTPHandler to serve the images: using System; using System.Web; namespace Example { public class GetImage : IHttpHandler { public ...
Why not create a log-directory in the user's %APPDATA% directory? Do you really need to put all the logs in the install directory? Why?
The ["D" programming language][1] is C++-like but has much better metaprogramming support. Here's an example of a ray-tracer written using only compile-time metaprogramming: [Ctrace][2] Additionally, there is a gcc branch called "Concept GCC" that supports metaprogramming contructs that C++ doesn't (at least not ...
how about `fldField = '%YYY%'`
Put a router between you and the internet, and don't forward any ports to your laptop. That way anyone trying to access the laptop hits the router and can't get any further. You can forward ports to your main machine (or just put the main machine in the DMZ) if you need it to be available to incoming connections.
Is "do not load this page directly" really necessary in PHP?
|php|methodology|
I was going to ask what the best way to do this is, but then decided I should ask whether or not it is even necessary. I have never seen it done in JSP development, but it appears to be common practice in PHP. What is the reasoning behind this, and if I do not protect against this, what else should I be taking into con...
If you're open to doing Java, GWT is the way to go. It allows you to have a relatively uniform codebase across client-server, and to only use one language on both. There are some limitations to doing very off-the-beaten-path AJAXy things (which GWT makes difficult, but not impossible), but it doesn't sound like that...
@Rich Bradshaw, I think you can get answer on your question by looking at any job seeking site. > what should I learn? Whatever you like and can bring you enough money.
Should a novice programmer spend time learning to write "desktop" applications these days, or is the web where it's at?
|desktop|
As a novice, I've spent time learning a smattering of C and a fair bit of PHP. I've looked at writing desktop applications for Windows, but there seems to be a fair barrier to entry due to complexity of APIs. Is it worth learning this, or will native applications become less common in the future? The way I see it, t...
|desktop|
|desktop|
<A HREF="http://www.ejabberd.im/">ejabberd</A> is written in Erlang. I don't know the details of the ejabberd implementation, but one advantage of using Erlang is really inexpensive threads. I'll speculate they start a thread per XMPP connection. In Erlang terminology these would be called processes, but these are not ...
Well, This is to prevent sensitive includes from being sent to the web-server directly. It's certainly not an all-inclusive security measure, but it could help with your particular setup. If however, your user was in a position to include the file from their own script, it won't help at all
**Interleaving `if` and `for` in list comprehensions** >>> [(x, y) for x in range(4) if x % 2 == 1 for y in range(4)] [(1, 0), (1, 1), (1, 2), (1, 3), (3, 0), (3, 1), (3, 2), (3, 3)] I never realized this until I learned Haskell.
First of all you need to inherit your TitleButton class from Component so that the designer knows it is a component that can be created via designer generated code. Then you need to instruct the designer code generator to work on the contents of the collection and not the collection instance itself. So try the followin...
Remote debugging is a godsend for debugging visual issues. It's a pain to set up, but having a VM ready for remote debugging will pay off for sure. What I like to do is set a ton of breakpoints in my paint handling, as well as in the framework paint code itself. This allows you to effectively "freeze frame" the pain...
The constructor's job is to bring the object into a usable state. There are basically two schools of thought on this. One group favors two-stage construction. The constructor merely brings the object into a sleeper state in which it refuses to do any work. There's an additional function that does the actual initiali...
I realize your only interested in a C implementation but I thought I'd comment on C++ and template metaprogramming anyway. I'm not completely convinced that it is possible in C++ as you need well defined initial conditions in order to terminate the recursive expansion. template<int A, int B> struct GCD { ...
- Allows you to write code/use library methods which are type-safe, i.e. a List&lt;string&gt; is guaranteed to be a list of strings. - As a result of generics being used the compiler can perform compile-time checks on code for type safety, i.e. are you trying to put an int into that list of strings? Using an ArrayList...
Compatability mode disables the features of the newer version, personally I haven't really worked with many databases that have issues, the key thing that was a problem in our environment is after moving to 9, you can no longer use Enterprise Manager to view the database. A backup/restore is a good option, and I als...
The primary advantage, as Mitchel points out, is strong-typing without needing to define multiple classes. This way you can do stuff like: List<SomeCustomClass> blah = new List<SomeCustomClass>(); blah[0].SomeCustomFunction(); Without generics, you would have to cast blah[0] to the correct type to acc...
With a solution open, go to the Debug - Exceptions (Ctrl+D,E) menu option. From there you can choose to break on Thrown or User-unhandled exceptions. EDIT: My instance is set up with the C# "profile" perhaps it isn't there for other profiles?
Think *good and hard* about what you really want `MyClass` for. I've noticed that some programmers write wrappers for their collections just as a matter of habit, regardless of whether they have any specific needs above and beyond those met by the standard STL collections. If that's your situation, then `typedef std::l...
Think *good and hard* about what you really want `MyClass` for. I've noticed that some programmers write wrappers for their collections just as a matter of habit, regardless of whether they have any specific needs above and beyond those met by the standard STL collections. If that's your situation, then `typedef std::l...
Firewall should be enough. But you can use the [Listen][1] directive as well. [1]: http://httpd.apache.org/docs/2.0/bind.html
A process cannot put itself into the background, because it isn't the one in charge of background vs. foreground. That would be the shell, which is waiting for process exit. If you launch a process with an ampersand "&" at the end, then the shell does *not* wait for process exit. But the only way the process can e...
The gems that I tend to use on most of my projects are: * Restful Authentication -- For authentication * Will Paginate -- For pagination * Attachment Fu -- For image and file attachments * RedCloth -- For textile rendering * Capistrano -- For deployment
The gems and plugins that I tend to use on most of my projects are: * [Restful Authentication](http://github.com/technoweenie/restful-authentication/tree/master) -- For authentication * [Will Paginate](http://github.com/mislav/will_paginate/tree/master) -- For pagination * [Attachment Fu](https://github.com/techno...
Oracle: Is there a simple way to say "if null keep the current value" in merge/update statements?
|sql|oracle-database|
There is at least one special case where for and foreach have been optimized to not generate the whole list at once. So you have the option of saying: for my $i ($#list) { my $item = some_function($list[$i]); ... } and this will iterate through the array, transformed however you like, with...