Daily Archives

Articles indexed Thursday April 8 2010

Page 17/125 | < Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >

  • Are these libraries okay to distribute with my C# application?

    - by HoNgOuRu
    I included these libraries or namespaces in my C# application and published the solution as freeware. I used Visual C# Express 2008. using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Media; using System.Management; using System.Diagnostics; using System.Runtime.InteropServices; using System.Drawing.Text; Is it okay to give the application as freeware or am I violating any license here???

    Read the article

  • Returning the value of an identity column during/after SQL INSERT command

    - by Adam Kane
    Using VS 2010, with ASP.NET, and .NET 3.0, and C#... When I use a System.Web.UI.WebControls.SqlDataSource and call its Insert() method to insert a new row, and that table has an identity column, I'd like my method to return the value of that column. For example, in my SQL 2005 table, I've got: Customer.Id Customer.FirstName Customer.LastName Where Customer.Id is an identity colum. When I call my method InsertNewCustomerRecord( "John", "Smith" ), I'd like to be able to return the Customer.Id that gets automatically generated in the database. Sorry for such a roughly posed question. Let me know if I can add better detail. Thanks.

    Read the article

  • Referencing both an old version and new version of the same DLL (VB.Net)

    - by ckittel
    Consider the following situation: WidgetCompany produced a .NET DLL in 2006 called Widget.dll, version 1.0. I consumed this Widget.dll file throughout my VB.Net application. Over time, WidgetCompany has been updating Widget.dll, I never bothered to keep up, continuing to ship version 1.0 of Widget.dll with my software. It's now 2010, my project is now a VB.Net 3.5 application and WidgetCompany has come out with Widget.dll version 3.0. It looks and functions almost identical to Widget.dll version 1.0, using all the same namespaces and type names from before. However, Widget.dll version 3.0 has many run-time breaking changes since 1.0 and I cannot simply cut over to the new version; however, I don't want to continue developing against the 1.0 version and therefore keep digging myself deeper in the hole. What I want to do is do all new development in my project with Widget.dll version 3.0, whilst keeping Widget.dll version 1.0 around until I find time to convert all of my 1.0 consumption to the newer 3.0 code. Now, for starters, I obviously cannot simply reference both Widget.dll (Ver 1.0) and Widget.dll (Ver 3.0) in Visual Studio. Doing so gives me the following message: "A reference to 'Widget.dll' could not be added. A reference to the component 'Widget' already exists in the project." To work around that, I can simply rename version 3.0 Widget.dll to Widget.3.dll. But this is where I'm stuck. Any attempts to reference types found in "the dll" leads to ambiguity and the compiler obviously doesn't have any clue as to what I really want in this or that case. Is there something I can do that gives a DLL a new "root" Namespace or something? For example, if I could say "Widget.dll has a new root namespace of Legacy" then I could update existing code to reference the types found in Legacy.<RootNamespace> namespace while all new code could simply reference types from the <RootNamespace> namespace. Pipe dream or reality? Are there other solutions to situations this (besides "don't get in this situation in the first place")?

    Read the article

  • Getting problem in Java OpenCV code.

    - by Chetan
    I had successfully compile my java code in Eclipse with name FaceDetection.java... I am getting an Exception in thread "main" java.lang.NoSuchMethodError: main.... Please help me to remove this Exception.. Here is the code import java.awt.; import java.awt.event.; import java.awt.image.MemoryImageSource; import hypermedia.video.OpenCV; @SuppressWarnings("serial") public class FaceDetection extends Frame implements Runnable { /** * Main method. * @param String[] a list of user's arguments passed from the console to this program */ public static void main( String[] args ) { System.out.println( "\nOpenCV face detection sample\n" ); new FaceDetection(); } // program execution frame rate (millisecond) final int FRAME_RATE = 1000/30; OpenCV cv = null; // OpenCV Object Thread t = null; // the sample thread // the input video stream image Image frame = null; // list of all face detected area Rectangle[] squares = new Rectangle[0]; /** * Setup Frame and Object(s). */ FaceDetection() { super( "Face Detection Sample" ); // OpenCV setup cv = new OpenCV(); cv.capture( 320, 240 ); cv.cascade( OpenCV.CASCADE_FRONTALFACE_ALT ); // frame setup this.setBounds( 100, 100, cv.width, cv.height ); this.setBackground( Color.BLACK ); this.setVisible( true ); this.addKeyListener( new KeyAdapter() { public void keyReleased( KeyEvent e ) { if ( e.getKeyCode()==KeyEvent.VK_ESCAPE ) { // ESC : release OpenCV resources cv.dispose(); System.exit(0); } } } ); // start running program t = new Thread( this ); t.start(); } /** * Draw video frame and each detected faces area. */ public void paint( Graphics g ) { // draw image g.drawImage( frame, 0, 0, null ); // draw squares g.setColor( Color.RED ); for( Rectangle rect : squares ) g.drawRect( rect.x, rect.y, rect.width, rect.height ); } /** * Execute this sample. */ @SuppressWarnings("static-access") public void run() { while( t!=null && cv!=null ) { try { t.sleep( FRAME_RATE ); // grab image from video stream cv.read(); // create a new image from cv pixels data MemoryImageSource mis = new MemoryImageSource( cv.width, cv.height, cv.pixels(), 0, cv.width ); frame = createImage( mis ); // detect faces squares = cv.detect( 1.2f, 2, OpenCV.HAAR_DO_CANNY_PRUNING, 20, 20 ); // of course, repaint repaint(); } catch( InterruptedException e ) {;} } } }

    Read the article

  • How to create Context Menu using XML file ?

    - by Kaillash
    I am using XML file for creating Context Menu for my ListView. (Please see below). I also want to set a header for this Context Menu. I read (at http://www.mail-archive.com/[email protected]/msg43062.html)that I can use menu.setHeaderTitle(myContextMenuTitle) in onCreateContextMenu Method. But I need to set this in XML file. How can I accomplish this? Following is code for onCreateContextMenu Method, correct me if I am doing anything wrong.. This is my context_menu.xml file: <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@+id/open" android:title="Open"/> </menu> This is my onCreateContextMenu Method: @Override public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) { MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.context_menu, menu); super.onCreateContextMenu(menu, v, menuInfo); } This is my onCreate Method: @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); // extras = getIntent().getExtras(); registerForContextMenu(getListView()); ... }

    Read the article

  • WPF Cursor Blink rate

    - by Daniel
    I have noticed that the cursor blinks really slowly in my WPF apps. This is much much slower then in the rest of windows. What I would like is for the Cursor blink rate to match the standard windows cursor blink rate.

    Read the article

  • Need help with some IIS7 web.config compression settings.

    - by Pure.Krome
    Hi folks, I'm trying to configure my IIS7 compression settings in my web.config file. I'm trying to enable HTTP 1.0 requests to be gzip. MSDN has all the info about it here. Is it possible to have this config info in my own website's web.config file? Or do i need to set it at an application level? Currently, I have that code in my web.config... <system.webServer> <urlCompression doDynamicCompression="true" dynamicCompressionBeforeCache="true" /> <httpCompression cacheControlHeader="max-age=86400" noCompressionForHttp10="False" noCompressionForProxies="False" sendCacheHeaders="true" /> ... other stuff snipped ... </system.webServer> It's not working :( HTTP 1.1 requests are getting compressed, just not 1.0. That MSDN page above says that it can be used in :- Machine.config ApplicationHost.config Root application Web.config Application Web.config Directory Web.config So, can we set these settings on a per-website-basis, programatically in a web.config file? (this is an Application Web.config file...) What have i done wrong? cheers :) EDIT: I was asked how i know HTTP1.0 is not getting compressed. I'm using the Failed Request Tracing Rules, which reports back:- DYNAMIC_COMPRESSION_START DYNAMIC_COMPRESSION_NOT_SUCESS Reason: 3 Reason: NO_COMPRESSION_10 DYNAMIC_COMPRESSION_END

    Read the article

  • SAS Array with or without expander

    - by tegbains
    Is it better to use a SAS Expander backplane for 12 drives via one SAS connection or is it better to use a SAS backplane with 3 SAS connections? This is in terms of performance, rather than expansion. This array will be setup using ZFS on a OpenSolaris via a LSI SAS controller as an iSCSI target. The two products being considered are the SuperMicro SuperChassis 826A-R1200LPB or the SuperChassis 826E2-R800LPB

    Read the article

  • Change the default program for a filetype to something not in "Program Files" in Windows Vista

    - by Carson Myers
    I'm trying to make my python scripts run in python 2.6 by default when run from the command line. This is paired with adding certain scripts to the PATH variable and .py to PATHEXT for convenience. But I'll be damned if I can get the file type association to work. In the default programs dialog (found in control panel) I find .py, and click "Change Program." This gives me the same dialog as clicking "Open with..." on a file's context menu. I search for python. Tell it to use python, but it doesn't add it to the list of programs I am allowed to use. I tried making a shortcut to python in Program Files, but that won't work either. If I copy python into a folder in Program Files, then that works. But why can't I just point it at C:\python26\python.exe (which is in the PATH variable) in the first place? Is there a way around this, or do I have to just reinstall python into Program Files?

    Read the article

  • How to solve "The ChannelDispatcher is unable to open its IChannelListener" error?

    - by kyrisu
    Hi, I'm trying to communicate between WCF hosted in Windows Service and my service GUI. The problem is when I'm trying to execute OperationContract method I'm getting "The ChannelDispatcher at 'net.tcp://localhost:7771/MyService' with contract(s) '"IContract"' is unable to open its IChannelListener." My app.conf looks like that: <configuration> <system.serviceModel> <bindings> <netTcpBinding> <binding name="netTcpBinding"> <security> <transport protectionLevel="EncryptAndSign" /> </security> </binding> </netTcpBinding> </bindings> <behaviors> <serviceBehaviors> <behavior name="MyServiceBehavior"> <serviceMetadata httpGetEnabled="true" httpGetUrl="http://localhost:7772/MyService" /> <serviceDebug includeExceptionDetailInFaults="true" /> </behavior> </serviceBehaviors> </behaviors> <services> <service behaviorConfiguration="MyServiceBehavior" name="MyService.Service"> <endpoint address="net.tcp://localhost:7771/MyService" binding="netTcpBinding" bindingConfiguration="netTcpBinding" name="netTcp" contract="MyService.IContract" /> </service> </services> </system.serviceModel> Port 7771 is listening (checked using netstat) and svcutil is able to generate configs for me. Any suggestions would be appreciated. Stack trace from exception Server stack trace: at System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(Message reply, MessageFault fault, String action, MessageVersion version, FaultConverter faultConverter) at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc) at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs) at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation) at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message) There's one inner exeption (but not under Exeption.InnerExeption but under Exeption.Detail.InnerExeption - ToString() method doesn't show that) A registration already exists for URI 'net.tcp://localhost:7771/MyService'. But my service have specified this URI only in app.config file nowhere else. In entire solution this URI apears in server once and client once.

    Read the article

  • How to create makefile for Lazarus projects?

    - by Gustavo Carreno
    After doing a light search on the Lazarus site I've come to the conclusion that this question has been asked some times but I haven't found an answer, so I'll ask my SO peers. Is there a a way to create a Makefile to replicate the action of the Lazarus IDE when it compiles a project. If so I really don't mind if it's makefile.fpc or just plain makefile, I just want some pointers on how to get to it. BTW, I've tried the option to enable the Makefile on the Lazarus options. Doesn't work.

    Read the article

  • VPATH in makefile issue.

    - by Ashok Patil
    Hello, I have a question related to VPATH. I'm playing around with make files and the VPATH variable. Basically, I'm grabbing source files from a few different places (specified by the VPATH), and trying to compile them into the another directory ( $CURDIR/OBJ/ ) using simply a list of .o-files that I want. Can I create .o's in any another directory other than current dir when using VPATH??

    Read the article

  • how i can get AspNetAccessProvider?

    - by loviji
    Hello, in my asp.net web application i used ASPNetSQLProvider for membership. Now i need use ASPNETAccessProvider. I wrote in webconfig file: <membership defaultProvider="AccessMembershipProvider" > <providers> <clear /> <add name="AccessMembershipProvider" type="System.Web.Security.AccessMembershipProvider" connectionStringName="AccessConnection" /> </providers> </membership> and trying to create user, and code fails : Could not load type 'System.Web.Security.AccessMembershipProvider'. How can i fix this?

    Read the article

  • Pylons paginator question

    - by Timmy
    Only comments associated with the current page should be listed, so once again the query is modified to include the page ID. In this case, though, we also have to pass the pageid argument, which will in turn get passed to any h.url_for() calls in the paginator. from http://pylonsbook.com/en/1.1/simplesite-tutorial-part-2.html i cannot get this to work, the paginator does not pass things to the h.url_for, i followed the tutorial. i had to add pageid to the h.url_for in list.html. how do i solve? part of the code: ${h.link_to( comment.id, h.url_for( controller=u'comment', action='view', id=unicode(comment.id) ) )} but it does not work properly until i put in ${h.link_to( comment.id, h.url_for( controller=u'comment', action='view', id=unicode(comment.id), pageid = c.page.id ) )}

    Read the article

  • Rails validation error messages: Displaying only one per field

    - by Sergio Oliveira Jr.
    Rails has an annoying "feature" which displays ALL validation error messages associated with a given field. So for example if I have 3 validates_XXXXX_of :email, and I leave the field blank I get 3 messages in the error list. This is non-sense. It is better to display one messages at a time. If I have 10 validation messages for a field does it mean I will get 10 validation error messages if I leave it blank? Is there an easy way to correct this problem? It looks straightforward to have a condition like: If you found an error for :email, stop validating :email and skip to the other field. Ex: validates_presence_of :name validates_presence_of :email validates_presence_of :text validates_length_of :name, :in = 6..30 validates_length_of :email, :in = 4..40 validates_length_of :text, :in = 4..200 validates_format_of :email, :with = /^([^@\s]+)@((?:[-a-z0-9]+.)+[a-z]{2,})$/i <%= error_messages_for :comment % gives me: 7 errors prohibited this comment from being saved There were problems with the following fields: Name can't be blank Name is too short (minimum is 6 characters) Email can't be blank Email is too short (minimum is 4 characters) Email is invalid Text can't be blank Text is too short (minimum is 4 characters)

    Read the article

  • Dice face value recognition

    - by Jakob Gade
    I’m trying to build a simple application that will recognize the values of two 6-sided dice. I’m looking for some general pointers, or maybe even an open source project. The two dice will be black and white, with white and black pips respectively. Their distance to the camera will always be the same, but their position on the playing surface will be random. (not the best example, the surface will be a different color and the shadows will be gone) I have no prior experience with developing this kind of recognition software, but I would assume the trick is to first isolate the faces by searching for the square profile with a dominating white or black color (the rest of the image, i.e. the table/playing surface, will in distinctly different colors), and then isolate the pips for the count. Shadows will be eliminated by top down lighting. I’m hoping the described scenario is so simple (read: common) it may even be used as an “introductory exercise” for developers working on OCR technologies or similar computer vision challenges.

    Read the article

  • Ways to generate database full structure based on Fluent NHibernate mappings

    - by Mendy
    I'm looking for ways to generate the application database full structure based on the NHibernate mapping data. The idea is to give the user an option to supply a database-connection string and then to build their a database with the structure that the application needs. The database need to independent - it means that it needs to work with any database that are supported by NHibernate. By full structure I mean that I want to generate also the index fields, and the relationship between tables. Is their few ways to accomplish this with NHibernate? Is so, what are they?

    Read the article

  • Is it a good idea to "migrate business logic code into our domain model"?

    - by Bytecode Ninja
    I am reading Hibernate in Action and the author suggests to move business logic into our domain models (p. 306). For instance, in the example presented by the book, we have three entities named Item, Bid, and User and the author suggests to add a placeBid(User bidder, BigDecimal amount) method to the Item class. Considering that usually we have a distinct layer for business logic (e.g. Manager or Service classes in Spring) that among other things control transactions, etc. is this really a good advice? Isn't it better not to add business logic methods to our entities? Thanks in advance.

    Read the article

  • Hibernate Criteria: Add restrictions to Criteria and DetachedCriteria

    - by Gilean
    Currently our queries add a variety of Restrictions to ensure the results are considered active or live. These Restrictions are used in several places/queries so a method was setup similar to public Criteria addStandardCriteria(Criteria criteria, ...) { // Add restrictions, create aliases based on parameters // and other non-trivial logic criteria.add(...); return criteria; } This has worked fine so far, but now this standard criteria needs to be added to a subquery using DetachedCriteria. Is there a way to modify this method to accept Criteria or DetachedCriteria or a Better way to add restrictions?

    Read the article

< Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >