instruction
stringlengths
0
30k
If I understand you question correctly, you want to express Oracle user defined types in WCF services? This will really depend on the protocol to be used. For example, if you are using one of the SOAP protocols like the WS* protocols, then you are stuck with those data types that are defined in SOAP. Going from any ...
const correctness is still const correctness regardless of whether you use the STL or not. I believe what you are looking for is to make registeredNames a "const char **" so that the assignment to registeredNames[i] (which is a const char *) works. Moreover, is this really what you want to be doing? It seems like ma...
I'd like to suggest the beagleboard from TI. It has a Omap3 on it. That's a Cortex-A8 ARM11 CPU, a C64x+ DSP and a video accelerator as well. The board does not need an expensive jtag device. A serial cable an an SD-Card is all you need to get started. Board costs only $150 and there is a very active community. w...
Following resources might be helpful: MSDN: [How To Use the ODBC .NET Managed Provider in Visual C# .NET and Connection Strings][1] CodeProject.com [An ODBC (DSN/Driver) Manager DLL written in C#][2] [1]: http://support.microsoft.com/kb/310988 [2]: http://www.codeproject.com/KB/database/sdbODBCM...
Following resources might be helpful: MSDN: [How To Use the ODBC .NET Managed Provider in Visual C# .NET and Connection Strings][1] CodeProject.com [An ODBC (DSN/Driver) Manager DLL written in C#][2] You can try to invoke functions: SQLWriteDSNToIni and ConfigDSN (MSDN links are dead for some reaso...
I think this may give you some modicum of safety and might save you a little bandwidth if people do send you crazy long URLs, but largely you should just validate your data in the actual application as well. Multiple levels of security are generally better, but don't make the mistake of thinking that because you have ...
The problem has to do with the CLOB columns. It seems that the imp tool cannot rewrite the create statement to use another tablespace. Source: <http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:66890284723848> The solution is: Create the schema by hand in the correct tablespace. If you do not h...
The problem has to do with the CLOB columns. It seems that the imp tool cannot rewrite the create statement to use another tablespace. Source: <http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:66890284723848> The solution is: Create the schema by hand in the correct tablespace. If you do not h...
Depends on the compiler, but with gcc (for example, since that's the one you referred to), some of the standard (both C and POSIX) functions have builtin "compiler intrinsics". This means that the compiler library shipped with your compiler (libgcc in this case) contains an implementation of the function. The compile...
The problem is that from CTP 1 to CTP2, they switched up the Invoke stuff, all the remoting stuff is done through `Invoke-Command` now, and `Invoke-Expression` is solely for turning a string into a script ;) P.S.: If you're on v2 you can run `$PSVersionTable` to see a list of versions including the CLR and Build ver...
If that code needs to get added to all models and all controllers, you could always do the following: # maybe put this in environment.rb or in your module declaration class ActiveRecord::Base include Iso end # application.rb class ApplicationController include Iso end...
namespace System.Web.Mvc { public static class ViewPageExtensions { public static string GetDefaultPageTitle<T>(this ViewPage<T> view) where T : class { return ""; } } } You may also need/wish to add the...
The best way to do that on an embedded system is to set an external hardware pin when you enter the function and clear it when you leave the function. This is done preferably with a little assembly instruction so you don't skew your results too much. Edit: One of the benefits is that you can do it in your actual ap...
Its only a bad practice, if you cannot encapsulate it well. Like everything else, you can create nasty, unreadable spaghetti code, except now you have tags to content with, which by design aren't the most readable things in the world. I try and keep tons of if's out of hte template, but excessive encapsulation, l...
<pre><code>% sudo apt-get install apache2-utils</code></pre>
Just remember that memory leaks are really about you not cleaning up after yourself. All you need is a little organization. In the past, I have created my own proxy object for attaching events to DOM elements. It uses my javascript library's api to actually set and remove events. The proxy itself just keeps track of...
Go to your main method (Program.cs). You'll put your logic there, and determine what to do , and conditionally execute Application.Run()
You should try the [Javascript Memory Leak detector][1] developed internally at Microsoft. [1]: http://blogs.msdn.com/gpde/pages/javascript-memory-leak-detector.aspx
Quick google turned up a Wikipedia article. http://en.wikipedia.org/wiki/Export_of_cryptography But as of now it seems like the "No need to reinvent the wheel" is correct.
I believe you can ask AR to load specific columns in your invocation to find: MyModel.find(id, :select => 'every, attribute, except, the, blobs') However, this would need to be updated as you add columns, so it's not ideal. I don't think there is any way to specifically exclude one column in rails (nor in a ...
PySec is another monadic parser, I don't know much about it, but it's worth looking at. http://www.valuedlessons.com/2008/02/pysec-monadic-combinatoric-parsing-in.html
What are all the different ways to create an object in Java?
|java|
Had a conversation with a coworker the other day about this. There's the obvious which is to use a constructor, but what other ways are there?
Unit Testing in .NET: How to Mock Entity Data Provider
|unit-testing|entity-framework|mocking|
Does anyone know whether there's a way to mock Entity Data Provider so Unit Tests don't hit the live data? I found this blog but it seems the project hasn't been released: http://www.chrisdoesdev.com/index.php/archives/62 Thanks
A general way to find out the answer to this question is to load the page you want to delegate to (http://technorati.com/people/technorati/USERNAME in this case), look at the source, and find the server tag used there. If there are openid2 tags, you should copy those as well.
[Cloning][1] and [deserialization][2]. [1]: http://en.wikipedia.org/wiki/Clone_(Java_method) [2]: http://exampledepot.com/egs/java.io/DeserializeObj.html
Awstats provides a perl script that can merge several apache log files together. This script scales well since the memory footprint is very low, logs files are never loaded in memory. I know that si not exactly what you needs, but perhaps you can start from this script and adapt it for your needs.
If you just want to test the build, you can suppress the lines concerning ChartFx from the .licx file created by Visual Studio. It should build this way, but probably will not execute correctly, as the license will not be included. The .licx file contains instructions to include binary license resource during build....
Has a debugging aid, you could use strace to see what operations is taking time. There might be some surprising thing with the FAT/FAT32. Do you write into a single file, or in multiple file ? You can make a reading thread, that will maintain a pool of video buffer ready to be written in a queue. When a frame ...
How can I cycle through pages?
|php|html|
Here's a challenge that I was tasked with recently. I still haven't figured out the best way to do it, maybe someone else has an idea. Using PHP and/or HTML, create a page that cycles through any number of other pages at a given interval. For instance, we would load this page and it would take us to google for 2...
Cross-Database information_schema Joins in SQL Server
|sql|sql-server|data-migration|
I am attempting to provide a general solution for the migration of data from one schema version to another. A problem arises when the column data type from the source schema does not match that of the destination. I would like to create a query that will perform a preliminary compare on the columns data types to return...
Interesting answers. Thank you for the pointers to wikipedia - whilst interesting - they don't actually solve the problem as stated as I was looking for exact matches - more of an accounting / book blancing problem than a traditional bin-packing / knapsack problem. I have been following the development of stack over...
If you are not expecting that input, reject it. You should always validate your inputs, and certainly discard anything outside of the expected range. If you already know that your URL's honestly won't be beyond a certain length then rejecting it before it gets to the application seems wise.
Cliff Click has dome some major research on lock free data structures by utilizing finite state machines and also posted a lot of implementations for Java. You can find his papers, slides and implementations at his blog: http://blogs.azulsystems.com/cliff/
I'd say no. It's just false security. Just program well and check your requests for bad stuff. It should be enough. Also, it's not future proof.
Yes. If it's too long and you're sure then reject it as soon as possible. If you can, reject it before it reaches your application (for example IISLockdown will do this). Remember to account for character encoding though.
Better than checking length, I think you should check content. You never know how you're going to use your URL schema in the future, but you can always sanitize your inputs. To put a very complex thing very simply: Don't trust user-supplied data. Don't put it directly into DB queries, don't eval() it, don't take anythi...
If you know valid URLs can't be over *N* bytes then it sounds like a good way to quickly reject cross-site-scripting attempts without too much effort.
I really would choose C# instead of C++. For Windows client apps, it can't be beat. For C/C++ dude like you, the syntax learning curve will be short. The difficulty will be learning the .NET framework, but that's the cost you'll have to incur one way or the other. Once you select C#, just pick either Windows For...
It should be just fine. It supports C# 3.0 now. I usually try to stick with targeting 2.0 though and it is very stable. Winforms and ASP.NET have both worked fine for me. The only thing to consider is there is currently no support for WPF.
Oddly enough, this is something I remember Jeff covering ages ago, but I guess it's still relevant if you're on IIS 5.1: http://www.codinghorror.com/blog/archives/000329.html
I've tried doing some C++ programming in .Net (Windows Forms). And while it was possible it was certainly not a pleasurable experience, mostly because you have some extra keywords and such which differ from standarad C++. But if you're willing to learn some more C++ it's an option. Myself I have started working on a...
Maybe you have a look at the SwingWorker Project which is included in JSE 6. [(Link to SwingWorker)][1] In the book "Filthy Rich Client" that I am reading at the moment they use this tool a lot. Maybe you can find a hint in the examples on the books website: [http://filthyrichclients.org/][2] [1]: http://swingwo...
You're using the wrong tools. Through the course of my last major project, we managed to convince the entire team to move to a Wiki scheme. Not only did it make tracking changes faster and easier, but it helped organize the information better. Rather than having to keep track of arbitrary indexes in a large text docume...
Do you want formatted urls to be a factory for spawning pages? or do you want to make the .aspx go away? rewriting, is for making the .aspx go away, or just to tidy up the url. Routing, is for looking at a request and determining which object should handle it. They sound similar, phil haack has a few good...
Symlink in windows XP
|windows|unix|
The question is how to make the similar thing like symlink in windows like in *nix. It's really hard to write whole path to the file in console (even using [tab], it's not the way if you need to change language). Adding everything in PATH is tiring too. It'll be great to make a symlink running one command. Actually ...
It is generally not recommended to do so, a connection string in the Application variable, with a nice helper function/class is a much preferred method. [Here](http://classicasp.aspfaq.com/components/should-i-store-objects-in-session/application-scope.html) is some reference.
They're called [junctions][1] And if you want a [GUI][2] to do it for you... [1]: http://articles.techrepublic.com.com/5100-10878_11-5388706.html [2]: http://www.rekenwonder.com/linkmagic.htm
If you have Beyond Compare, you can diff two word documents with the help of some rules that you have to download from the developer's site and plugin. It'll then give you a text-only (without formatting) view (with some word format-gibberish that you can ignore. The differences will be highlighted and easy to find. ...
The Dynamic Data project that is available with .Net 3.5 SP1 shows a good example of a url routing implementation.
I believe that google becomes the namespace for your imported libraries. Try: `google.dojo.require`.
I believe that google becomes the namespace for your imported libraries. Try: `google.dojo.require`. Oh! And as pointed out below, don't forget to use google.setOnLoadCallback instead of calling your function directly.
<pre><code>% sudo apt-get install apache2-utils</code></pre> The command-not-found package in Ubuntu provides some slick functionality where if you type a command that can't be resolved to an executable (or bash function or whatever) it will query your apt sources and find a package that contains the binary you trie...
In OS X terminal (and probably Unix, too), use "time":<br /> time python function.py
I don't know if it's what you require, but perhaps you may want to investigate creating your own custom resource factory for Tomcat. Here is the general documentation for all things resources via Tomcat: [Tomcat Resources][1] [1]: http://tomcat.apache.org/tomcat-6.0-doc/jndi-resources-howto.html
I would also suggest looking at the different algorithms in the digest namespace. To make it harder to guess, rather than (or in addition to) salting with a secret passphrase, you can also use a precise dump of the time: require 'digest/md5' def hash_url(url) Digest::MD5.hexdigest("#{Time.now.to_f}--...
Use a class that with static properties to represent the enumeration values. You can, optionally, use a private constructor to force all references to the class to go through a static property. Take a look at the System.Drawing.Color class. It uses this approach.
Person JeffAtwood; Person JoelSpolsky; JeffAtwood.TalkTo(JoelSpolsky); Here's hoping for no tail recursion!
One of my favorites is constructor type checking: function getObjectType( obj ) { return obj.constructor.name; } window.onload = function() { alert( getObjectType( "Hello World!" ) ); function Cat() { // some code here... } ...
If you've got $179 you're done. - [http://www.tangiblesoftwaresolutions.com/Product_Details/Instant_CSharp.htm][1] Of course there are freeware converters available as well. - [http://www.google.com/search?q=convert+vb.net+csharp][2] [1]: http://www.tangiblesoftwaresolutions.com/Product_Details/In...
What's caused similar "layout" delays for myself was related to the **AutoSizeRowsMode** and **AutoSizeColumnsMode** DataGridView1.**AutoSizeRowsMode** = None will likely fix it. Also try **ColumnHeadersHightSizeMode** and **AllowUserToResizeRows**
Sniffing traffic between a Flex app and ColdFusion backend
|apache-flex|debugging|coldfusion|sniffing|amf|
What is a good strategy for sniffing/tracing function calls between a Flex application and a ColdFusion-based backend running on ColdFusion server? I understand they use AMF protocol. I'm used to using [Fiddler][1] to sniff transactions between HTTP clients and servers, and it works great as long as you're using pla...
Actually I just got it working. The problem is that I need to modify the <a href="..."> path to an absolute path to the view page because the relative path doesn't work with the MVC routes {controller}/{action}/{id}. Thanks!
Reflection: someClass.newInstance();
Why don't you try bashing F3? :)
This is a CI build, so I want to see the diffs on each build, cleaning out the build gives me a fresh build each time, and I don't know what is new. So its a known issue?
Asp XML Parsing
|asp|xml|parsing|
I am new to asp and have a deadline in the next few days. i receive the following xml from within a webservice response. `print("<?xml version="1.0" encoding="UTF-8"?> <user_data> <execution_status>0</execution_status> <row_count>1</row_count> <txn_id>stuetd678</txn_id> <person_info> <attribute name="firstname...
|xml|parsing|asp|
I am new to asp and have a deadline in the next few days. i receive the following xml from within a webservice response. `print("<?xml version="1.0" encoding="UTF-8"?> <user_data> <execution_status>0</execution_status> <row_count>1</row_count> <txn_id>stuetd678</txn_id> <person_info> <attribute name="firstname...
My C# project - we'll call it the SuperUI - used to make use of a class from an external assembly. Now it doesn't, but the compiler won't let me build the project without the assembly reference in place. Let me elaborate. This project used to throw and catch a custom exception class - the `SuperException` - which wa...
I've had a problem like this (tho not the same) in the past where my control was in a different namespace to my form even tho it was in the same project. To fix it I had to add a using My.Other.Namespace; to the top of the designer generated code file. The annoying thing was it kept getting blown away when t...
The two big downsides to using fields instead of properties are: 1. You can't databind to a whereas you can to a property 2. If you start off using a field, you can't later (easily) change them to a property 3. There are some attributes that you can add to a property that you can't add to a field
The three big downsides to using fields instead of properties are: 1. You can't databind to a whereas you can to a property 2. If you start off using a field, you can't later (easily) change them to a property 3. There are some attributes that you can add to a property that you can't add to a field
That would be int indexVal = 0; Regex re = new Regex(@"Index: (\d*)"); Match m = re.Match(s); if (m.Success) indexVal = m.Groups[1].Index; You can also name you group (here I've also skipped compilation of the regexp) int indexVal = 0; Match m2 = Regex.Match(s, @"Index: (?<myIndex>\...
It sounds like you'll need to treat the SQL Statement as an expression. For example: ="Select col1, col2 from table 1 Where col3 = " & Parameters!Param1.Value If the where clause is a string you would need to do the following: ="Select col1, col2 from table 1 Where col3 = '" & Parameters!Param1.Value ...
The £ symbol (U+00A3), and the html entities & #163; and & pound; should all render the same in a browser. If the browser doesn't recognise £, it probably won't recognise the entity versions. It's in ISO 8859-1 (Latin-1), so I'd be surprised if a Mozilla browser can't render it (my FF certainly can). If you see...
If it is a dialog based application you can do it by calling EndDialog() function. If it is an SDI/MDI based application you can call DestroyWindow. But before which you will need to do the cleanup yourself (closing documents, deallocating memory and resources, destroying any additional windows created etc).
You can try something like: http://weblogs.asp.net/johnkatsiotis/archive/2008/09/14/asp-net-messagebox-server-and-client.aspx
[CxxTest][1] is a light, easy to use and cross platform JUnit/CppUnit/xUnit-like framework for C++. [1]: http://cxxtest.tigris.org/
The sub items will be saved along with the main item, and even identities will be set properly, if you give your DataClasses an association between these classes. You do this by adding LoadOptions to your O/R-Designer DataClasses like this: MyDataContext mydc = new MyDataContext(); System.Data.Linq.D...
Boost has a [Testing library][1] which contains support for unit testing. It might be worth checking out. [1]: http://www.boost.org/doc/libs/1_34_0/libs/test/doc/index.html
The modal dialog control I use is : http://foohack.com/tests/vertical-align/dialog.html http://foohack.com/2007/11/css-modal-dialog-that-works-right/ I find it works well across all browsers. I've hacked it round to work well with ASP .NET, and that was pretty easy.
I haven't used it personally, but [SwingUnit][1] looks quite good. You can use it with jUnit, and it isn't based on "location of components" (i.e. x and y co-ordinates). The only thing you may have to do with the NetBeans GUI Builder is set unique names for your components. [1]: https://swingunit.dev.java.net...
I've been playing around with [Balsamiq Mockups][1] and it's OK for basic wireframes. [1]: http://www.balsamiq.com/ "Balsamiq Mockups"
Static prevents the compiler from adding multiple instances. This becomes less important with #ifndef protection, but assuming the header is included in two seperate libraries, and the application is linked, two instances would be included.
"Replaying" the changes is easier than you might think. Here's the general outline of what you need to do: 1. Store the "original" version of the entity instance before you detach it and hand it to the UI. 2. Let the UI do its thing. 3. When you want to persist changes made by the UI to the database, take t...
What can cause MASM to display "junk"?