Daily Archives

Articles indexed Friday April 30 2010

Page 22/114 | < Previous Page | 18 19 20 21 22 23 24 25 26 27 28 29  | Next Page >

  • Remove application entry from switch-app menu

    - by bdhar
    What am I trying to achieve? I am writing a windows-form based application in C# .NET 2.0. The application should behave like this: No form should be visible; just a system tray icon is the entire application. So, I have to hide the form during startup and make a NotifyIcon available in the system tray with a ContextMenuStrip attached to it. What have I done so far? I have created a Windows application with the default form's properties WindowState-Minimized and ShowInTaskbar-false. Added a NotifyIcon and attached a ContextMenuStrip to it. What's happening? The application starts as a system tray icon and the form is hidden. So far so good. But when I am working with other applications and when I switch between other application using the Alt-Tab combination in Windows, the application icon appears in the switch-application menu; and when I select my application, the form appears. What's expected? The application should not be available in the switch-application menu; because, the form is empty and there is no functionality attached to it. All that is needed is the system-tray icon. How to hide the application entry from the switch-application menu? Thanks.

    Read the article

  • How to create a rails habtm that deletes/destroys without error?

    - by Bradley
    I created a simple example as a sanity check and still can not seem to destroy an item on either side of a has_and_belongs_to_many relationship in rails. Whenever I try to delete an object from either table, I get the dreaded NameError / "uninitialized constant" error message. To demonstrate, I created a sample rails app with a Boy class and Dog class. I used the basic scaffold for each and created a linking table called boys_dogs. I then added a simple before_save routine to create a new 'dog' any time a boy was created and establish a relationship, just to get things setup easily. dog.rb class Dog < ActiveRecord::Base has_and_belongs_to_many :Boys end boy.rb class Boy < ActiveRecord::Base has_and_belongs_to_many :Dogs def before_save self.Dogs.build( :name => "Rover" ) end end schema.rb ActiveRecord::Schema.define(:version => 20100118034401) do create_table "boys", :force => true do |t| t.string "name" t.datetime "created_at" t.datetime "updated_at" end create_table "boys_dogs", :id => false, :force => true do |t| t.integer "boy_id" t.integer "dog_id" t.datetime "created_at" t.datetime "updated_at" end create_table "dogs", :force => true do |t| t.string "name" t.datetime "created_at" t.datetime "updated_at" end end I've seen lots of posts here and elsewhere about similar problems, but the solutions are normally using belongs_to and the plural/singular class names being confused. I don't think that is the case here, but I tried switching the habtm statement to use the singular name just to see if it helped (with no luck). I seem to be missing something simple here. The actual error message is: NameError in BoysController#destroy uninitialized constant Boy::Dogs The trace looks like: /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:105:in const_missing' (eval):3:indestroy_without_callbacks' /Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/callbacks.rb:337:in destroy_without_transactions' /Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/transactions.rb:229:insend' ... Thanks.

    Read the article

  • java distributed cache for low latency, high availability

    - by Shahbaz
    I've never used distributed caches/DHTs like memcached, jboss cache, ehcache, etc. I'm wondering which, if any, is appropriate for my use. First, I'm not doing web applications (as most of these project seem to be geared towards web apps). I write servers (Order Management Systems actually) for financial trading firms. The servers themselves are not too complicated. They need to receive information (market data, orders, executions, etc.) rout them to their destination while possibly transforming some of these messages. I am looking at these products to solve the following problems: * Safe repository of the state of the server. I'd rather build the logic of my application as a bunch of transformers (similar to Apache Camel) and store the state in a 'safe' place * This repository should be distributed: in case one of these data stores crashes, one or two more should be up and I should be able to switch to them seamlessly * This repository should be fast. Single digits milliseconds count here, in other words, systems which consume/process this data are automated systems, not humans clicking on links. This system needs to have high-throughput and low latency. By sending my data outside the process, I am necessarily slowing performance, but I am trying to balance absolute raw speed and absolute protection of data. * This repository should be safe. Similar to the point about several on-line backups, this system needs to write data to disk (potentially more than one disk). I'd really like to stop writing my own 'transaction servers.' Am I correct to be looking into projects such as jboss cache, ehcache, etc.? Thanks

    Read the article

  • How to find my subversion server version number?

    - by elviejo
    I want to know if my server is running suberversion 1.5. How can I find that out? Also would be nice to know my svn client version number. svn help. Hasn't been helpful Note: I don't want my project's revision number, etc. This question is about the subversion software itself.

    Read the article

  • QT warning level suggestion

    - by metdos
    What is the warning level you use while compiling QT projects? When I compiled with W4, I'm getting a lot of warnings such as: C4127: conditional expression is constant Should I compile at W3, or find other ways to handle warnings at W4, such as: adding a new header file and using pragma's(mentioned here C++ Coding Standards: 101 Rules, Guidelines, and Best Practices). What are your practices? Thansk.

    Read the article

  • Cannot resolve the collation conflict between "Latin1_General_CI_AS" and "SQL_Latin1_General_CP1_CI_

    - by Patrick Olurotimi Ige
    I was writing a store proc for a report and i needed some data from another server so i added a linked server to connect to this new db server. when i do a select like below its all fine select a,b,c from Server.DatabaseName.dbo.table But when i use the table in a join i get the error "Cannot resolve the collation conflict between "Latin1_General_CI_AS" and "SQL_Latin1_General_CP1_CI_AS" in the equal to operation." I did check the collation set on the 2 databases and it was actually the same and had mo idea why i'm getting the error. I later found out that you could specifically tell it to use a COLLATE Just rewrite your join like this on a.name COLLATE Latin1_General_CI_AS = eaobjname Hope that helps and saves your precious time Patrick

    Read the article

  • Automate refactor import/using directives, using ReSharper and Visual Studio 2010

    - by Mendy
    I want to automate the Visual Studio 2010 / Resharper 5 auto inserting import directives to put my internal namespaces into the namespace sphere. Like this: using System; using System.Collections.Generic; using System.Linq; using StructureMap; using MyProject.Core; // <--- Move inside. using MyProject.Core.Common; // <--- Move inside. namespace MyProject.DependencyResolution { using Core; using Core.Common; // <--- My internal namespaces to be here! public class DependencyRegistrar { ........... } }

    Read the article

  • Adding picture in pickerview

    - by iSharreth
    UIImageView *one = [[UIImageView alloc]initWithImage:[[UIImage alloc] initWithContentsOfFile:[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"ball1.png"]]] ; UIImageView *two = [[UIImageView alloc]initWithImage:[[UIImage alloc] initWithContentsOfFile:[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"ball2.png"]]] ; UIImageView *three = [[UIImageView alloc]initWithImage:[[UIImage alloc] initWithContentsOfFile:[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"ball3.png"]]] ; arrayBalls = [[NSArray alloc]initWithObjects:one,two,three,nil]; I used the above code for displaying image in the pickerview. But the application is crashing when executing this code. Anyone please help.

    Read the article

  • Where to find great proxy servers for testing GeoIP services?

    - by Andreas
    We would like to test a GeoIP-Service. Therefore we need to go to the site with an IP from another country. There are a lot of free proxy lists like http://nntime.com/proxy-country/ The problem with them is, that only the CoDeen-Proxies are working. But with CoDeen you can't select your country of origin (the same as with TOR). You get redirected to a random proxy in the network. Where to find good proxy server for testing the GeoIP Services? Free proxy servers would be great, but if they cost something small that doesn't matter.

    Read the article

  • Relevance of 'public' constructor in abstract class.

    - by Amby
    Is there any relevance of a 'public' constructor in an abstract class? I can not think of any possible way to use it, in that case shouldn't it be treated as error by compiler (C#, not sure if other languages allow that). Sample Code: internal abstract class Vehicle { public Vehicle() { } } The C# compiler allows this code to compile, while there is no way i can call this contructor from the outside world. It can be called from derived classes only. So shouldn't it allow 'protected' and 'private' modifiers only. Please comment.

    Read the article

  • Emulator problem in Android

    - by AMANDEEP SINGH
    When I launch the emulator I face many problems (Errors):- HttpConnectionApp]emulator-5554 disconnected! Cancelling 'net.paxcel.http.HttpConnectionApp activity launch'! Emulator]emulator: ERROR: the user data image is used by another emulator. aborting Each time I have to re-run it but all in vain. How can I improve this so that I can re-run the application on same AVD?

    Read the article

  • File Format Conversion to TIFF. Some issues???

    - by Nains
    I'm having a proprietary image format SNG( a proprietary format) which is having a countinous array of Image data along with Image meta information in seperate HDR file. Now I need to convert this SNG format to a Standard TIFF 6.0 Format. So I studied the TIFF format i.e. about its Header, Image File Directories( IFD's) and Stripped Image Data. Now I have few concerns about this conversion. Please assist me. SNG Continous Data vs TIFF Stripped Data: Should I convert SNG Data to TIFF as a continous data in one Strip( data load/edit time problem?) OR make logical StripOffsets of the SNG Image data. SNG Data Header uses only necessary Meta Information, thus while converting the SNG to TIFF, some information can’t be retrieved such as NewSubFileType, Software Tag etc. So this raises a concern that after conversion whether any missing directory information such as NewSubFileType, Software Tag etc is necessary and sufficient condition for TIFF File. Encoding of each pixel component of RGB Sample in SNG data: Here each SNG Image Data Strip per Pixel component is encoded as: Out^[i] := round( LineBuffer^[i * 3] * **0.072169** + LineBuffer^[i * 3 + 1] * **0.715160** + LineBuffer^[i * 3+ 2]* **0.212671**); Only way I deduce from it is that each Pixel is represented with 3 RGB component and some coefficient is multiplied with each component to make the SNG Viewer work RGB color information of SNG Image Data. (Developer who earlier work on this left, now i am following the trace :)) Thus while converting this to TIFF, the decoding the same needs to be done. This raises a concern that the how RBG information in TIFF is produced, or better do we need this information?. Please assist...

    Read the article

  • Problem comparing keys in Appengine/Python

    - by ana
    I'm trying to create a relationship between "tables" with Appengine/Python. Imagine I have a "table" for items, and a table for colors. I save the color of an item by saving the color key as an atribute of the item. That's working well, but this particular piece of code is not working: <select id="colorKey" name="colorKey"> {% for color in colors %} <option value="{{ color.key }}"{% if color.key = item.colorKey %} selected="selected"{% endif %}> {{ color.name }} - {{ item.colorKey }} - {{ color.key }} </option> {% endfor %} </select> Since the {{ item.colorKey }} and {{ color.key }} variables are actually the same chain of characters, I only can think in a problem with the types. {{ item.colorKey }} is a string for sure. But maybe {{ color.key }} is not?

    Read the article

  • SQL Server: How to remove empty lines in SSMS?

    - by atricapilla
    I have many .sql files with lots of empty lines e.g. WITH cteTotalSales (SalesPersonID, NetSales) AS ( SELECT SalesPersonID, ROUND(SUM(SubTotal), 2) FROM Sales.SalesOrderHeader WHERE SalesPersonID IS NOT NULL GROUP BY SalesPersonID ) SELECT sp.FirstName + ' ' + sp.LastName AS FullName, sp.City + ', ' + StateProvinceName AS Location, ts.NetSales FROM Sales.vSalesPerson AS sp INNER JOIN cteTotalSales AS ts ON sp.BusinessEntityID = ts.SalesPersonID ORDER BY ts.NetSales DESC Is ther a way to remove these empty lines in SQL Server Management Studio? This is what I would like to have: WITH cteTotalSales (SalesPersonID, NetSales) AS ( SELECT SalesPersonID, ROUND(SUM(SubTotal), 2) FROM Sales.SalesOrderHeader WHERE SalesPersonID IS NOT NULL GROUP BY SalesPersonID ) SELECT sp.FirstName + ' ' + sp.LastName AS FullName, sp.City + ', ' + StateProvinceName AS Location, ts.NetSales FROM Sales.vSalesPerson AS sp INNER JOIN cteTotalSales AS ts ON sp.BusinessEntityID = ts.SalesPersonID ORDER BY ts.NetSales DESC

    Read the article

  • Using STL/Boost to initialize a hard-coded set<vector<int> >

    - by Hooked
    Like this question already asked, I'd like to initialize a container using STL where the elements are hard-coded in the cleanest manner possible. In this case, the elements are a doubly nested container: set<vector<int> > A; And I'd like (for example) to put the following values in: A = [[0,0,1],[0,1,0],[1,0,0],[0,0,0]]; C++0x fine, using g++ 4.4.1. STL is preferable as I don't use Boost for any other parts of the code (though I wouldn't mind an example with it!).

    Read the article

  • How to implement an interface class using the non-virtual interface idiom in C++?

    - by andreas buykx
    Hi all, In C++ an interface can be implemented by a class with all its methods pure virtual. Such a class could be part of a library to describe what methods an object should implement to be able to work with other classes in the library: class Lib::IFoo { public: virtual void method() = 0; }; : class Lib::Bar { public: void stuff( Lib::IFoo & ); }; Now I want to to use class Lib::Bar, so I have to implement the IFoo interface. For my purposes I need a whole of related classes so I would like to work with a base class that guarantees common behavior using the NVI idiom: class FooBase : public IFoo // implement interface IFoo { public: void method(); // calls methodImpl; private: virtual void methodImpl(); }; The non-virtual interface (NVI) idiom ought to deny derived classes the possibility of overriding the common behavior implemented in FooBase::method(), but since IFoo made it virtual it seems that all derived classes have the opportunity to override the FooBase::method(). If I want to use the NVI idiom, what are my options other than the pImpl idiom already suggested (thanks space-c0wb0y).

    Read the article

  • Microsoft Small Business Licensing Kick Start

    - by regex
    I seem to recall hearing at some point (I believe it was MIX09) that Microsoft has a licensing model of some sort where a business can consume licenses for up to two years, free of charge, until they reach a point where they are stable position and can pay their licensing at the end of two years. However, I can't find information regarding it online. I want to say that possibly stackoverflow used this licensing model to kick start their site. Is anyone familiar with this?

    Read the article

  • linux raw socket programming question

    - by user194420
    Hi all, I am trying to create a raw socket which send and receive message with ip/tcp header under linux. I can successfully binds to a port and receive tcp message(ie:syn) However, the message seems to be handled by the os, but not mine. I am just a reader of it(like wireshark). My raw socket binds to port 8888, and then i try to telnet to that port . In wireshark, it shows that the port 8888 reply a "rst ack" when it receive the "syn" request. In my program, it shows that it receive a new message and it doesnot reply with any message. Any way to actually binds to that port?(prevent os handle it) Here is part of my code, i try to cut those error checking for easy reading sockfd = socket(AF_INET, SOCK_RAW, IPPROTO_TCP); int tmp = 1; const int *val = &tmp; setsockopt (sockfd, IPPROTO_IP, IP_HDRINCL, val, sizeof (tmp)); servaddr.sin_family = AF_INET; servaddr.sin_addr.s_addr = htonl(INADDR_ANY); servaddr.sin_port = htons(8888); bind(sockfd, (struct sockaddr*)&servaddr, sizeof(servaddr)); //call recv in loop

    Read the article

< Previous Page | 18 19 20 21 22 23 24 25 26 27 28 29  | Next Page >