Daily Archives

Articles indexed Saturday March 27 2010

Page 7/84 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • Ruby: Calling class method from instance

    - by Peter
    In Ruby, how do you call a class method from one of that class's instances? Say I have class Truck def self.default_make # Class method. "mac" end def initialize # Instance method. Truck.default_make # gets the default via the class's method. # But: I wish to avoid mentioning Truck. Seems I'm repeating myself. end end the line Truck.default_make retrieves the default. But is there a way of saying this without mentioning Truck? It seems like there should be.

    Read the article

  • Implementing a horizontal compass on the iPhone - algorithm?

    - by Andrew Johnson
    A horizontal compass looks something like this if you are facing due East (90 degrees). 85----90---95 If you were facing due 355 degrees northwest, it would look like this: 350----355---0 As you turn the compass, the number should cycle from 0 - 360 - 0 So, my question is, how would you implement a view like this on the iPhone? I had a couple of ideas: Make one long image with all numbers and tick marks, and shift it left/right when the compass heading changes Create pieces of the view as tiles and append them when the compass heading changes. Create a line of tick marks that shifts with the compass heading, and just write numbers on it as needed. How would you attack this problem? Im mainly looking for algorithmic advice, but if you ave code or pseudo-code to demonstrate, that would be helpful too.

    Read the article

  • How to Copy CD+Graphics / Karaoke CDs?

    - by Jim McKeeth
    Is there any good software to copy CD+Graphics (aka Karaoke CDs) for Windows 7? Preferably free. I can copy the audio portion just fine, but for some reason I keep looking the karaoke lyrics / graphics portion. It used to be that a lot of the software supported these specifically, but now I am having a hard time finding any mention of this feature, and the ones I have tried didn't work.

    Read the article

  • Website looks weird in internet explorer 7, but fine in IE 6 and 8

    - by user156814
    I used many different browsers while I was coding for a new site (Firefox, Chrome, IE8, Opera, Safari, Mobile devices, etc...). It looked the same across all browsers. I recently uploaded the site onto the server and got to look at it from work, using Internet Explorer 7 and It looks horrible. Elements are floating wild all over the place, but I cant figure out why. The weird thing is I just looked at it from IE6, and it looks fine, with the exception of unsupported transparencies in PNG's. If anybody has IE7, you can view the site here. Thanks

    Read the article

  • With C# 3.0, how to write Interface based code with generic collection?

    - by Deecay
    I want to write code that is decouple and clean, and I know that by programming to an interface instead of the implementation, my code will be more flexible and extensible. So, instead of writing methods like: bool IsProductAvailable(ProductTypeA product); I write methods like: bool IsProductAvailable(IProduct product); As long as my products implement IProduct: class ProductTypeA : IProduct I should be OK. All is well until I start using generic collections. Since C# 3.0 doesn't support covariant and contravariant, even though both ProuctTypeA and ProductTypeB implements IProduct, you cannot put List in List. This is pretty troublesome because a lot of times I want to write something like: bool AreProductsAvailable(List<IProduct> products); So that I can check product avaialbility by writing: List<ProductA> productsArrived = GetDataFromDataabase(); bool result = AreProductsAvailable(productsArrived); And I want to write just one AreProductsAvailable() method that works with all IProduct collections. I know that C# 4.0 is going to support covariant and contravariant, but I also realize that there other libraries that seemed to have the problem solved. For instance, I was trying out ILOG Gantt the gantt chart control, and found that they have a lot of collection intefaces that looks like this: IActivityCollection ILinkCollection So it seems like their approach is wrapping the generic collection with an interface. So instead of "bool AreProductsAvailable(List products);", I can do: bool AreProductsAvailable(IProductCollection products); And then write some code so that IProductCollection takes whatever generic collection of IProduct, be it List or List. However, I don't know how to write an IProductCollection interface that does that "magic". :-< (ashame) .... Could someone shed me some light? This has been bugging me for so long, and I so wanted to do the "right thing". Well, thanks!

    Read the article

  • replace a whole page useing GreaseMonkey

    - by RYan
    is there a way to replace a whole web page using GreaseMonkey? basically a redirection but the address bar still shows the original address. i want the original address to show, but i want to load a modified web page from my hard drive without anyone knowing. thanks

    Read the article

  • Problem on Windows 7 using Image.FromStream to open cmyk+alpha tiff file

    - by Stefan Andersson
    I'm having a problem running the following code om Windows 7 x86 when creating an Image from a lzw encoded cmyk + alpha TIFF file. The FromStream call throws a System.ArgumentException: Parameter is not validRunning When I run the code on Vista or Server 2008 (both x86 and x64 bit) it just works. using System; using System.Drawing; using System.Drawing.Imaging; . . . using (FileStream stream = File.OpenRead(fileName)) { using (Image image = Image.FromStream(stream, false, false)) { // Do something with the image } }

    Read the article

  • DataGrid - Edit the selected row when a button is clicked.

    - by Chepech
    Hi all. I have a very simple DataGrid with 2 columns, some thing like this: <mx:DataGrid id="grid" > <mx:columns> <mx:DataGridColumn dataField="name" headerText="Name"/> <mx:DataGridColumn dataField="date" headerText="Date"/> </mx:columns> </mx:DataGrid> What Im trying to do is to activate the edition of the selected row when the user clicks a button. So far I've been unable to find any example of how to do this. I already tried 6 or 7 different approaches but non works. Does any one has a clue how to do this? How do you get the selected row (NOT selectedItem) of a DataGrid and how can you: Change the ItemRenderEditor or ItemRenderer on the fly of just that row. Or enable the edition of that specific row without clicking it. This are the questions that I've been unable to answer Help will be greatly appreciated.

    Read the article

  • Polygon triangulation

    - by Saurabh
    Hey, I am working on nesting of sheet metal parts and am implementing Minkowski Sums to find No Fit Polygons for nesting. The problem is I can give only convex sets as input to the code which calculates Minkowski sums for me. Hence I need to break a concave polygon, with holes into Convex sets. I am open to triangulation also, but I am looking for a working code on VC++ (6.0). I am slightly running short on time as my whole code is ready and just waiting for input in the form of convex sets. I would really appreciate if somebody with prior experience can help me in this. I have gone through other posts but did not find anything matching to this. I am a student of mechanical engineering and really dun have much idea about computer languages. All I can handle is compiling a code on VC++ and incorporate it with my existing code. Looking forward to responses!! Thanks Warm regards Saurabh India

    Read the article

  • TFS Solution build cascading to several other builds even when common components were not modified

    - by Bob Palmer
    Hey all, here is the issue I am currently trying to work through. We are using Team Foundation Server 2008, and utilizing the automated build support out of the box. We have one very large project that encompasses a number of interrelated components and web sites, each of which is set up as a Visual Studio solution file. Many of these solutions are highly interrelated since they may contain applications, or contain common libraries or shared components. We have roughly 20 or so applications, three large web sites, and about 20 components. Each solution may include projects from other solutions. For example, a solution for a console app would also include the project files for all of the components it utilizes, since we need to ensure that when someone changes a component and rebuilds it, it is reflected in all of the projects that consume that component, and we can make sure nothing was broken. We have build projects for each solution, whether that's an application, component, or web site. For this example, we will call them solutions 01, 02, and 03. These reference multiple projects (both their own core project and test projects, plus the projects relating to various components). Solution 01 has projects A, B, and C. Solution 02 has projects C, D, and E. Solution 03 has projects E, F, and G. Now, for the problem. If I modify project A, the system will end up rebuilding all three solutions. Worse, all thirty solutions reference common projects used for data access (let's call it project H). Because they all share one project in common, if I modify any solution in my stack, even if it does not touch project H, I still end up kicking off every single build script. Any thoughts on how to address this? Ideally I would only want to kick off builds where their constituant projects were directly modified - i.e in the example below, if I modified project C, I would only rebuild solutions 01 and 02. Thanks!

    Read the article

  • how to disable minimize button in frame?

    - by vybhav
    can i disable minimize button in frame?how?(i hav already tried setUndecorated() and setResizable().both didnt work). i m trying to add imags to a panel at a random location which i m able to do) bt wen frame is minimized by clicking at the minimize button (not wen frame minimizes by clicking at the background window) images assemble at the top in a row. help guys..... thanks

    Read the article

  • Mvc Redirect with IIS and Request Verification Token

    - by zsharp
    I am using IIS 7 rewrite to redirect certain pages to https. It seems that my post from such a page fails because i have Request Verification token attribute on the controller. Is this expected behavior or do I have something configured incorrectly? what to do to get around this? works fine without the https redirect.

    Read the article

  • PostgreSQL 8.4 won't start after blackout

    - by RiZe
    I have problem with starting PostgreSQL 8.4 on Ubuntu 9.10 Server after blackout. When I try to connect to the database it says: psql: server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request. When I try to start it by using command sudo -u postgres /etc/init.d/postgresql-8.4 start * Starting PostgreSQL 8.4 database server [ OK ] Netstat output netstat -tulp (No info could be read for "-p": geteuid()=1000 but you should be root.) Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 localhost:postgresql *:* LISTEN - tcp 0 0 192.168.1.35:svn *:* LISTEN - tcp 0 0 192.168.1.35:http-alt *:* LISTEN - tcp 0 0 *:ssh *:* LISTEN - tcp6 0 0 localhost:postgresql [::]:* LISTEN - tcp6 0 0 [::]:ssh [::]:* LISTEN - udp 0 0 *:bootpc *:* - But still don't work so lets restart it sudo -u postgres /etc/init.d/postgresql-8.4 restart * Restarting PostgreSQL 8.4 database server * The PostgreSQL server failed to start. Please check the log output: 2009-11-30 13:39:37 CET LOG: database system was shut down at 2009-11-30 13:39:33 CET 2009-11-30 13:39:37 CET LOG: autovacuum launcher started 2009-11-30 13:39:37 CET LOG: database system is ready to accept connections 2009-11-30 13:39:37 CET LOG: incomplete startup packet 2009-11-30 13:39:38 CET LOG: server process (PID 2240) was terminated by signal 11: Segmentation fault 2009-11-30 13:39:38 CET LOG: terminating any other active server processes 2009-11-30 13:39:38 CET LOG: all server processes terminated; reinitializing 2009-11-30 13:39:38 CET LOG: database system was interrupted; last known up at 2009-11-30 13:39:37 CET 2009-11-30 13:39:38 CET LOG: database system was not properly shut down; automatic recovery in progress 2009-11-30 13:39:38 CET LOG: record with zero length at 0/11D464C 2009-11-30 13:39:38 CET LOG: redo is not required 2009-11-30 13:39:38 CET LOG: autovacuum launcher started 2009-11-30 13:39:38 CET LOG: database system is ready to accept connections 2009-11-30 13:39:38 CET LOG: server process (PID 2248) was terminated by signal 11: Segmentation fault 2009-11-30 13:39:38 CET LOG: terminating any other active server processes 2009-11-30 13:39:38 CET LOG: all server processes terminated; reinitializing 2009-11-30 13:39:38 CET LOG: database system was interrupted; last known up at 2009-11-30 13:39:38 CET 2009-11-30 13:39:38 CET LOG: database system was not properly shut down; automatic recovery in progress 2009-11-30 13:39:38 CET LOG: record with zero length at 0/11D4690 2009-11-30 13:39:38 CET LOG: redo is not required 2009-11-30 13:39:39 CET LOG: autovacuum launcher started 2009-11-30 13:39:39 CET LOG: database system is ready to accept connections 2009-11-30 13:39:39 CET LOG: server process (PID 2256) was terminated by signal 11: Segmentation fault 2009-11-30 13:39:39 CET LOG: terminating any other active server processes 2009-11-30 13:39:39 CET LOG: all server processes terminated; reinitializing 2009-11-30 13:39:39 CET LOG: database system was interrupted; last known up at 2009-11-30 13:39:38 CET 2009-11-30 13:39:39 CET LOG: database system was not properly shut down; automatic recovery in progress 2009-11-30 13:39:39 CET LOG: record with zero length at 0/11D46D4 2009-11-30 13:39:39 CET LOG: redo is not required 2009-11-30 13:39:39 CET LOG: autovacuum launcher started 2009-11-30 13:39:39 CET LOG: database system is ready to accept connections 2009-11-30 13:39:39 CET LOG: server process (PID 2264) was terminated by signal 11: Segmentation fault 2009-11-30 13:39:39 CET LOG: terminating any other active server processes 2009-11-30 13:39:39 CET LOG: all server processes terminated; reinitializing 2009-11-30 13:39:39 CET LOG: database system was interrupted; last known up at 2009-11-30 13:39:39 CET 2009-11-30 13:39:39 CET LOG: database system was not properly shut down; automatic recovery in progress 2009-11-30 13:39:40 CET LOG: record with zero length at 0/11D4718 2009-11-30 13:39:40 CET LOG: redo is not required 2009-11-30 13:39:40 CET LOG: autovacuum launcher started 2009-11-30 13:39:40 CET LOG: database system is ready to accept connections 2009-11-30 13:39:40 CET LOG: server process (PID 2272) was terminated by signal 11: Segmentation fault 2009-11-30 13:39:40 CET LOG: terminating any other active server processes 2009-11-30 13:39:40 CET LOG: all server processes terminated; reinitializing 2009-11-30 13:39:40 CET LOG: database system was interrupted; last known up at 2009-11-30 13:39:40 CET 2009-11-30 13:39:40 CET LOG: database system was not properly shut down; automatic recovery in progress 2009-11-30 13:39:40 CET LOG: record with zero length at 0/11D475C 2009-11-30 13:39:40 CET LOG: redo is not required 2009-11-30 13:39:40 CET LOG: autovacuum launcher started 2009-11-30 13:39:40 CET LOG: database system is ready to accept connections 2009-11-30 13:39:41 CET LOG: server process (PID 2280) was terminated by signal 11: Segmentation fault 2009-11-30 13:39:41 CET LOG: terminating any other active server processes 2009-11-30 13:39:41 CET LOG: all server processes terminated; reinitializing 2009-11-30 13:39:41 CET LOG: database system was interrupted; last known up at 2009-11-30 13:39:40 CET 2009-11-30 13:39:41 CET LOG: database system was not properly shut down; automatic recovery in progress 2009-11-30 13:39:41 CET LOG: record with zero length at 0/11D47A0 2009-11-30 13:39:41 CET LOG: redo is not required 2009-11-30 13:39:41 CET LOG: autovacuum launcher started 2009-11-30 13:39:41 CET LOG: database system is ready to accept connections 2009-11-30 13:39:41 CET LOG: server process (PID 2288) was terminated by signal 11: Segmentation fault 2009-11-30 13:39:41 CET LOG: terminating any other active server processes 2009-11-30 13:39:41 CET LOG: all server processes terminated; reinitializing 2009-11-30 13:39:41 CET LOG: database system was interrupted; last known up at 2009-11-30 13:39:41 CET 2009-11-30 13:39:41 CET LOG: database system was not properly shut down; automatic recovery in progress 2009-11-30 13:39:41 CET LOG: record with zero length at 0/11D47E4 2009-11-30 13:39:41 CET LOG: redo is not required 2009-11-30 13:39:41 CET LOG: autovacuum launcher started 2009-11-30 13:39:41 CET LOG: database system is ready to accept connections 2009-11-30 13:39:42 CET LOG: server process (PID 2296) was terminated by signal 11: Segmentation fault 2009-11-30 13:39:42 CET LOG: terminating any other active server processes 2009-11-30 13:39:42 CET LOG: all server processes terminated; reinitializing 2009-11-30 13:39:42 CET LOG: database system was interrupted; last known up at 2009-11-30 13:39:41 CET 2009-11-30 13:39:42 CET LOG: database system was not properly shut down; automatic recovery in progress 2009-11-30 13:39:42 CET LOG: record with zero length at 0/11D4828 2009-11-30 13:39:42 CET LOG: redo is not required 2009-11-30 13:39:42 CET LOG: autovacuum launcher started 2009-11-30 13:39:42 CET LOG: database system is ready to accept connections 2009-11-30 13:39:42 CET LOG: server process (PID 2304) was terminated by signal 11: Segmentation fault 2009-11-30 13:39:42 CET LOG: terminating any other active server processes 2009-11-30 13:39:42 CET LOG: all server processes terminated; reinitializing 2009-11-30 13:39:42 CET LOG: database system was interrupted; last known up at 2009-11-30 13:39:42 CET 2009-11-30 13:39:42 CET LOG: database system was not properly shut down; automatic recovery in progress 2009-11-30 13:39:42 CET LOG: record with zero length at 0/11D486C 2009-11-30 13:39:42 CET LOG: redo is not required 2009-11-30 13:39:43 CET LOG: autovacuum launcher started 2009-11-30 13:39:43 CET LOG: database system is ready to accept connections 2009-11-30 13:39:43 CET LOG: server process (PID 2312) was terminated by signal 11: Segmentation fault 2009-11-30 13:39:43 CET LOG: terminating any other active server processes 2009-11-30 13:39:43 CET LOG: all server processes terminated; reinitializing 2009-11-30 13:39:43 CET LOG: database system was interrupted; last known up at 2009-11-30 13:39:42 CET 2009-11-30 13:39:43 CET LOG: database system was not properly shut down; automatic recovery in progress 2009-11-30 13:39:43 CET LOG: record with zero length at 0/11D48B0 2009-11-30 13:39:43 CET LOG: redo is not required 2009-11-30 13:39:43 CET LOG: autovacuum launcher started 2009-11-30 13:39:43 CET LOG: database system is ready to accept connections [fail] So what happened and what can I do to solve this? Thanks for replies

    Read the article

  • Simple Webserver failover

    - by yummm
    I will be running a dynamic web site and if the server ever is to stop responding, I'd like to failover to a static website that displays a "We are down for maintenance" page. I have been reading and I found that switching the DNS dynamically may be an option, but how quick will that change take place? And will everyone see the change immediately? Are there any better ways to failover to another server?

    Read the article

  • outlook signature problem

    - by user20989
    i have created signature for my windows mail signature html file has following code. <table border="0" cellspacing="0" cellpadding="0"> <tr> <td>Regards</td> </tr> <tr> <td><img src="http://images.google.com/intl/en_ALL/images/logos/images_logo_lg.gif" align="Signature Picture" /></td> </tr> </table> its working fine once i send message, but when if i foreword send item again i got signature but image not display. once i check the source of email i found following change in signature image automatically like <IMG height=128 alt="Compnay Logo" src="mhtml:{4B829C94-37FC-44B9-A60C-CC4BB1E0AE9B}mid://00000152/!http://images.google.com/intl/en_ALL/images/logos/images_logo_lg.gif" width=206 border=0> how to fix it. or any other way to put image in signature (not image is also hosted on web server) Thanks

    Read the article

  • Basic Scolling Question

    - by localgamer
    Hey guys, im pretty new to android platform and have a really simple question. Im putting buttons as layouts with text boxes, but im running out of room. How would i make it possible for the user to scroll down to view more buttons and stuff. For example, if i have 6 buttons, and 3 are in the field of view, i wanna be able to scroll with my finger and be able to see those buttons as I scroll. Thanks for the help guys -Localgamer

    Read the article

  • For Loop Question?

    - by NextRev
    I'm programming an app for the iPhone. I'm not very good with loops just yet. How do I shorten this code into a for loop? if(CGRectContainsRect([space1 frame], [box frame])){ space1.image = [UIImage imageNamed:@"box.png"]; } else if(CGRectContainsRect([space2 frame], [box frame])){ space2.image = [UIImage imageNamed:@"box.png"]; } else if(CGRectContainsRect([space3 frame], [box frame])){ space3.image = [UIImage imageNamed:@"box.png"]; } else if(CGRectContainsRect([space4 frame], [box frame])){ space4.image = [UIImage imageNamed:@"box.png"]; } else if(CGRectContainsRect([space5 frame], [box frame])){ space5.image = [UIImage imageNamed:@"box.png"]; }

    Read the article

  • Standardizing a Release/Tools group on a specific language

    - by grahzny
    I'm part of a six-member build and release team for an embedded software company. We also support a lot of developer tools, such as Atlassian's Fisheye, Jira, etc., Perforce, Bugzilla, AnthillPro, and a couple of homebrew tools (like my Django release notes generator). Most of the time, our team just writes little plugins for larger apps (ex: customize workflows in Anthill), long-term utility scripts (package up a release for QA), or things like Perforce triggers (don't let people check into a specific branch unless their change description includes a bug number; authenticate against Active Directory instead of Perforce's internal passwords). That's about the scale of our problems, although we sometimes tackle something slightly more sizable. My boss, who is reasonably technical, has asked us to standardize on one or two languages so we can more easily substitute for each other. He's advocating bash scripts and Perl, due to their universality and simplicity. I can see his point--we mostly do "glue", so why not use "glue" languages rather than saddle ourselves with something designed for much larger projects? Since some of the tools we work with are Java-based, we do need to use something that speaks JVM sometimes. (The path of least resistance for these projects is BeanShell and Groovy.) I feel a tremendous itch toward language advocacy, but I'm trying to avoid saying "We should use Python 'cause I like it and Perl is gross." Instead, I'm trying to come up with a good approach to defining our problem set: what problems do we solve with scripts? Would we benefit from a library of common functions by our team, or are most of our projects more isolated? What is it reasonable to expect my co-workers to learn? What languages give us the most ease of development and ease of modification? Can you folks suggest some useful ways to approach this problem, both for my own thinking process and to help me facilitate some brainstorming among my coworkers?

    Read the article

  • List of Lua derived VMs and Languages

    - by Shane Holloway
    Is there a compendium of virtual machines and languages derived or inspired by Lua? By derived, I mean usage beyond embedding and extending with modules. I'm wanting to research the Lua technology tree, and am looking for our combined knowledge of what already exists. Current List: Bright - A C-like Lua Derivative http://bluedino.net/luapix/Bright.pdf Agena - An Algol68/SQL like Lua Derivative http://agena.sourceforge.net/ LuaJIT - A (very impressive) JIT for Lua http://luajit.org MetaLua - An ML-style language extension http://metalua.luaforge.net/

    Read the article

  • Automatic e-mail processing

    - by Jon Harrop
    I'd like to write a .NET application in F# to automate some of the processing of my e-mails. For example, when an order comes in my program might compute a new htpasswd from the e-mail's contents, upload it to our web server and reply to the customer with login details. How do people do this? I've tried Outlook 2007 automation but it just prompts the user for security and my attempts to get it to stop doing this have failed so I cannot automate anything with it. Is there a .NET-friendly e-mail client I can use more easily? This has been so tedious that I'm seriously considering writing my own .NET-friendly e-mail client...

    Read the article

  • .Net MEF newbie question

    - by steve.macdonald
    I am missing something basic when it comes to using MEF. I got it working using samples and a simple console app where everything is in the same assembly. Then I put some imports and exports in a separate project which contains various entities. I want to use these entities in an MS Test, but the composition is never actually done. When I move the composition stuff into the constructor of an entity in question it works, but that's obviously wrong. Does GetExecutingAssembly only "see" the test process? What am I missing re containers? I tried putting the container in a Using in the test without luck. The MEF docs are still very scant and I can't find a simple example of an application (or MS Test) which uses entities from a different project...

    Read the article

  • Windows SBS 2003 DNS taking over network

    - by Simon
    I have Windows Small Business Server 2003 premium edition on my new server box, this hosts a webapp on IIS. It has set up a DNS Server to solve requests to the webapp. I have a linux server/router that has does DNAT and portforwards port 80 to the new box. My linux router serves as a firewall and dhcp When i plug the SBS2003 server to the network, it leaves everyone on my network without web browsing, it looks like the DNS requests are going to the new server. I configured the DNS forwarders on SBS2003 to my ISP dns but it doesnt work... Is there something i am missing?

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >