Daily Archives

Articles indexed Thursday April 1 2010

Page 15/126 | < Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >

  • show array size with will_paginate

    - by chief
    @users = User.paginate( :page => params[:page], :per_page => 2, I would like to return the total number of results. @users.size simply gives me the number of results on a page. If page 1 has 2 users @users.size = 2, going to page 2 with say 1 user @users.size = 1. How can I show the size of all the users?

    Read the article

  • BufferedReader.readLine() gives error java.net.SocketException: Software caused connection abort: re

    - by javatcp
    I am trying to code my program such that until the buffered reader gets something in readLine() from my tcp client it should keep running in the while loop checking but I get this error as soon as the program executes Mar 31, 2010 11:03:36 PM deswash.DESWashView$5 run SEVERE: null java.net.SocketException: Software caused connection abort: recv failed at java.net.SocketInputStream.socketRead0(Native Method) at java.net.SocketInputStream.read(SocketInputStream.java:129) at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:264) at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:306) at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:158) at java.io.InputStreamReader.read(InputStreamReader.java:167) at java.io.BufferedReader.fill(BufferedReader.java:136) at java.io.BufferedReader.readLine(BufferedReader.java:299) at java.io.BufferedReader.readLine(BufferedReader.java:362) at deswash.DESWashView$5.run(DESWashView.java:448) the second line in the following code throws the error while(running){ String temp = in.readLine(); if(!(temp.equals(null))){ int inid = Integer.parseInt(temp); stationList.add(inid); } }

    Read the article

  • Is it possible to virtualize war file execution without separate J2EE container deployments?

    - by Smith
    Let's say I want to allow my developers to upload their war files to a web app (not the application server itself) running on our intranet and that web app would then run those wars as if they were separate apps deployed individually in our J2EE container. In other words, we are not actually deploying the wars as separate apps in the container - they are simply running side-by-side inside this one web app that acts like a J2EE container. Is that possible? Something like a war virtualization app?

    Read the article

  • Database source control with Oracle

    - by borjab
    I have been looking during hours for a way to check in a database into source control. My first idea was a program for calculating database diffs and ask all the developers to imlement their changes as new diff scripts. Now, I find that if I can dump a database into a file I cound check it in and use it as just antother type of file. The main conditions are: Works for Oracle 9R2 Human readable so we can use diff to see the diferences. (.dmp files doesn't seem readable) All tables in a batch. We have more than 200 tables. It stores BOTH STRUCTURE AND DATA It supports CLOB and RAW Types. It stores Procedures, Packages and its bodies, functions, tables, views, indexes, contraints, Secuences and synonims. It can be turned into an executable script to rebuild the database into a clean machine. Not limitated to really small databases (Supports least 200.000 rows) It is not easy. I have downloaded a lot of demos that does fail in one way or another. EDIT: I wouldn't mind alternatives aproaches provided that they allows us to check a working system against our release DATABASE STRUCTURE AND OBJECTS + DATA in a bath mode. By the way. Our project has been developed for years. Some aproaches can be easily implemented when you make a fresh start but seem hard at this point. EDIT: To understand better the problem let's say that some users can sometimes do changes to the config data in the production eviroment. Or developers might create a new field or alter a view without notice in the realease branch. I need to be aware of this changes or it will be complicated to merge the changes into production.

    Read the article

  • Problems with my HTML/CSS

    - by Michael
    Note below is my CSS. This is a three column website. my main content is in the center. The problems that I am having is that my main content does not adjust correctly to IE. It is fine in FF but not in IE. .columns3headers2 #mainContent1 { margin: 0 22% 0 24%; width: 570px; background-color: #DDDDDD; height: 370px; padding: 0, 10, 0, 0; border: groove } .columns3headers2 #mainContent2 { margin: 0 22% 0 24%; width: 570px; background-color: #DDDDDD; height: 190px; border: groove } I do not have much in my main content. <div id="mainContent1"> <h1> Main Content </h1> <div id="cround"> <h3>Absolute Value</h3> <ul> <li>Test 1</li> <li>Test 2</li> <li>Test 3</li> <li>test 4</li> </ul> </p> </div>

    Read the article

  • Unable to load <mytest> Because it is not located under Appbase

    - by Sam
    I have created a nunit project(NunitLoginTest.nunit) by selcting my test project in the nunit\bin directory and now I am trying to load that project but it is giving me the following error. Unable to load Because it is not located under Appbase, could not load file or assembly "nunitLogintest" or one of its dependencies. The system cannot find the specified path Can any one have any idea what is it related to. I also have checked my config file.

    Read the article

  • How do I reset the scale/zoom of a web app on an orientation change on the iPhone?

    - by Elisabeth
    I'm having the same problem that a couple of others have had with getting the correct behavior in a web app on an orientation change, and there doesn't seem to be an obvious solution - I've seen this question asked a couple of times on Stack Overflow and no one's yet been able to answer it. When I start the app in portrait mode, it works fine. Then I rotate into landscape and it's scaled up. To get it to scale correctly for the landscape mode I have to double tap on something twice, first to zoom all the way in (the normal double tap behavior) and again to zoom all the way out (again, the normal double tap behavior). When it zooms out, it zooms out to the correct NEW scale for landscape mode. Switching back to portrait seems to work more consistently; that is, it handles the zoom so that the scale is correct when the orientation changes back to portrait. I am trying to figure out if this is a bug? or if this is something that can be fixed with Javascript? With the viewport meta content, I am setting the initial-scale to 1.0 and I am NOT setting minimum or maximum scale (nor do I want to). I am setting the width to device-width. Any ideas? I know a lot of people would be grateful to have a solution as it seems to be a persistent problem. Thank you!

    Read the article

  • HTTP Error: 400 when sending msmq message over http

    - by dontera
    I am developing a solution which will utilize msmq to transmit data between two machines. Due to the seperation of said machines, we need to use HTTP transport for the messages. In my test environment I am using a Windows 7 x64 development machine, which is attempting to send messages using a homebrew app to any of several test machines I have control over. All machines are either windows server 2003 or server 2008 with msmq and msmq http support installed. For any test destination, I can use the following queue path name with success: FORMATNAME:DIRECT=TCP:[machine_name_or_ip]\private$\test_queue But for any test destination, the following always fails FORMATNAME:DIRECT=HTTP://[machine_name_or_ip]/msmq/private$/test_queue I have used all permutations of machine names/ips available. I have created mappings using the method described at this blog post. All result in the same HTTP Error: 400. The following is the code used to send messages: MessageQueue mq = new MessageQueue(queuepath); System.Messaging.Message msg = new System.Messaging.Message { Priority = MessagePriority.Normal, Formatter = new XmlMessageFormatter(), Label = "test" }; msg.Body = txtMessageBody.Text; msg.UseDeadLetterQueue = true; msg.UseJournalQueue = true; msg.AcknowledgeType = AcknowledgeTypes.FullReachQueue | AcknowledgeTypes.FullReceive; msg.AdministrationQueue = new MessageQueue(@".\private$\Ack"); if (SendTransactional) mq.Send(msg, MessageQueueTransactionType.Single); else mq.Send(msg); Additional Information: in the IIS logs on the destination machines I can see each message I send being recorded as a POST with a status code of 200. I am open to any suggestions.

    Read the article

  • Tutorial: Linux Commands: Making Bash Error Messages Friendlier

    Bash error messages, like so many error messages, can be more cryptic than helpful. But the good news is bash has a built-in mechanism for creating your own customized error messages, and you don't have to be an ace programmer to do it. Ubuntu and openSUSE already use this; Akkana Peck shows us how to do it ourselves.

    Read the article

  • Browsers with good keyboard support

    - by egon
    What browsers have good keyboard support? That means you don't have to use the mouse so much. Or what is a good setup for browser + keyboard interaction. I know the basic keyboard shortcuts (tab switching, new tabs etc.) but I don't know a good way to switch between links and search areas - usually that means TAB, Shift-TAB one at a time. Is there maybe some plugin that'll add numbers to links and I could just do something like 12 to go to the link 12?

    Read the article

  • Palit GeForce 8800GT 512MB Minimum Power Requirement?

    - by Wesley
    Hi all, I am building a system for a friend. The potential specs are like this so far: ASUS A8N-VM motherboard AMD Athlon 64 3200+ @ 2.0 GHz Any 7200RPM SATA HDD Palit GeForce 8800GT 512MB GDDR3 PCIe One DVD/CD combo drive Creative SB Live! 5.1 sound card I was wondering what wattage of power supply would be able to support this hardware. I had a 350W in mind... would that do? Thanks in advance.

    Read the article

  • Sun Ray 3 Plus Unboxing video

    - by [email protected]
    Shot using a prototype Sun Ray 3 Plus weeks before the Oracle acquisition of Sun was completed, this video gives you the sense of how this newly announced Sun Ray 3 Plus is packaged when shipped.   It also shows what the bits of the SR 3 Plus are all about, including the most commonly asked about specs.  While the Production unit is available for ordering NOW, it will obviously have the Oracle logo in addition to the Sun logo.Enjoy the video here:

    Read the article

  • How to deploy code using git

    - by luckytaxi
    I have a bare repository initialize on my webserver. I code on my workstation and I'm able to push/pull/commit changes to it. Now, I want to deploy this code on the webserver but into my apache directory (/var/www/html). If I wanted to track the changes (only pull no push) from this directory, should I clone the repo first? This way I can make changes locally, then commit and push to "central repo" and then pull from the documentroot folder to see the changes in "prod."

    Read the article

  • Why protected superclass member cannot be accessed in a subclass function when passed as an argument

    - by KNoodles
    I get a compile error, which I'm slightly confused about. This is on VS2003. error C2248: 'A::y' : cannot access protected member declared in class 'A' class A { public: A() : x(0), y(0) {} protected: int x; int y; }; class B : public A { public: B() : A(), z(0) {} B(const A& item) : A(), z(1) { x = item.y;} private: int z; }; The problem is with x = item.y; The access is specified as protected. Why doesn't the constructor of class B have access to A::y?

    Read the article

  • Dependency Walker Not Showing All the Depended Dll

    - by Ngu Soon Hui
    I have a fortran dll, and I want to know the assemblies that it depends on for redistribution purpose. One thing I found out is that the dependency walker doesn't show all of the dependencies, i.e, there are some dlls that my assembly is dependent on, but dependency walker doesn't show it out. An example would be a dll that makes use of intel mkl LAPACK dlls, but the dependency walker doesn't show that dependency. Why this is so? And any idea how to fix this problem, or is there other more reliable tool that I can use?

    Read the article

  • ASP.NET MVC and WCF

    - by Michael Stum
    I'm working my way into MVC at the moment, but on my "To learn at some point" list, I also have WCF. I just wonder if WCF is something that should/could be used in an MVC Application or not? The Background is that I want a Desktop Application (.NET 3.5, WPF) interact with my MVC Web Site, and I wonder what the best way to transfer data between the two is. Should I just use special Views/have the controllers return JSON or XML (using the ContentResult)? And maybe even more important, for the other way round, could I just call special controllers? Not sure how Authorization would work in such a context. I can either use Windows Authentication or (if the Site is running forms authentication) have the user store his/her credentials in the application, but I would then essentially create a HTTP Client in my Application. So while MVC = Application seems really easy, Application = MVC does seem to be somewhat tricky and a possible use for WCF? I'm not trying to brute-force WCF in this, but I just wonder if there is indeed a good use case for WCF in an MVC application.

    Read the article

  • Silverlight 4 Overriding the DataForm Autogenerate to insert Combo Boxes bound to Converters.

    - by kmacmahon
    I've been working towards a solution for some time and could use a little help. I know I've seen an example of this before, but tonight I cannot find anything close to what I need. I have a service that provides me all my DropDownLists, either from Cache or from the DomainService. They are presented as IEnumerable, and are requested from the a repository with GetLookup(LookupId). I have created a custom attribute that I have decorated my MetaDataClass that looks something like this: [Lookup(Lookup.Products)] public Guid ProductId I have created a custom Data Form that is set to AutoGenerateFields and I am intercepting the autogenerate fields. I am checking for my CustomAttribute and that works. Given this code in my CustomDataForm (standard comments removed for brevity), what is the next step to override the field generation and place a bound combobox in its place? public class CustomDataForm : DataForm { private Dictionary<string, DataField> fields = new Dictionary<string, DataField>(); public Dictionary<string, DataField> Fields { get { return this.fields; } } protected override void OnAutoGeneratingField(DataFormAutoGeneratingFieldEventArgs e) { PropertyInfo propertyInfo = this.CurrentItem.GetType().GetProperty(e.PropertyName); foreach (Attribute attribute in propertyInfo.GetCustomAttributes(true)) { LookupFieldAttribute lookupFieldAttribute = attribute as LookupFieldAttribute; if (lookupFieldAttribute != null) { // Create a combo box. // Bind it to my Lookup IEnumerable // Set the selected item to my Field's Value // Set the binding two way } } this.fields[e.PropertyName] = e.Field; base.OnAutoGeneratingField(e); } } Any cited working examples for SL4/VS2010 would be appreciated. Thanks

    Read the article

  • How do I get column names to print in this C# program?

    - by Kevin
    I've cobbled together a C# program that takes a .csv file and writes it to a datatable. Using this program, I can loop through each row of the data table and print out the information contained in the row. The console output looks like this: --- Row --- Item: 1 Item: 545 Item: 507 Item: 484 Item: 501 I'd like to print the column name beside each value, as well, so that it looks like this: --- Row --- Item: 1 Hour Item: 545 Day1 KW Item: 507 Day2 KW Item: 484 Day3 KW Item: 501 Day4 KW Can someone look at my code and tell me what I can add so that the column names will print? I am very new to C#, so please forgive me if I've overlooked something. Here is my code: // Write load_forecast data to datatable. DataTable loadDT = new DataTable(); StreamReader sr = new StreamReader(@"c:\load_forecast.csv"); string[] headers = sr.ReadLine().Split(','); foreach (string header in headers) { loadDT.Columns.Add(header); // I've added the column headers here. } while (sr.Peek() > 0) { DataRow loadDR = loadDT.NewRow(); loadDR.ItemArray = sr.ReadLine().Split(','); loadDT.Rows.Add(loadDR); } foreach (DataRow row in loadDT.Rows) { Console.WriteLine("--- Row ---"); foreach (var item in row.ItemArray) { Console.Write("Item:"); Console.WriteLine(item); // Can I add something here to also print the column names? } }

    Read the article

  • Documenting user scenarios and measuring/testing

    - by Rimian
    Please forgive me as I don't quite remember the exact terms for what I am talking about... hence my question. Recently I worked on a large Agile team where I encountered a method of defining user scenarios (much like user stories). These scenarios were a few very basic short sentences with keywords and a structure that could be understood by humans (especially project managers) and could also be coded against using some Java Framework (for verifying tests). The exact structure of this mini language used keywords like "when" and "and" or "if" which was how the framework parsed and verified the result. The purpose of this framework was to interface between management and the acceptance testing framework. So essentially management could write the tests themselves using English. The scenario went something like this: "When a user visits URL and User clicks on X Something happens (that can be measured)" Can anyone help me remember exactly what I am talking about? Many thanks

    Read the article

  • Extending XHTML

    - by Daniel Schaffer
    I'm playing around with writing a jQuery plugin that uses an attribute to define form validation behavior (yes, I'm aware there's already a validation plugin; this is as much a learning exercise as something I'll be using). Ideally, I'd like to have something like this: Example 1 - input: <input id="name" type="text" v:onvalidate="return this.value.length > 0;" /> Example 2 - wrapper: <div v:onvalidate="return $(this).find('[value]').length > 0;"> <input id="field1" type="text" /> <input id="field2" type="text" /> <input id="field3" type="text" /> </div> Example 3 - predefined: <input id="name" type="text" v:validation="not empty" /> The goal here is to allow my jQuery code to figure out which elements need to be validated (this is already done) and still have the markup be valid XHTML, which is what I'm having a problem with. I'm fairly sure this will require a combination of both DTD and XML Schema, but I'm not really quite sure how exactly to execute. Based on this article, I've created the following DTD: <!ENTITY % XHTML1-formvalidation1 PUBLIC "-//W3C//DTD XHTML 1.1 +FormValidation 1.0//EN" "http://new.dandoes.net/DTD/FormValidation1.dtd" > %XHTML1-formvalidation1; <!ENTITY % Inlspecial.extra "%div.qname; " > <!ENTITY % xhmtl-model.mod SYSTEM "formvalidation-model-1.mod" > <!ENTITY % xhtml11.dtd PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" > %xhtml11.dtd; And here is "formvalidation-model-1": <!ATTLIST %div.qname; %onvalidation CDATA #IMPLIED %XHTML1-formvalidation1.xmlns.extra.attrib; > I've never done DTD before, so I'm not even really exactly sure what I'm doing. When I run my page through the W3 XHTML validator, I get 80+ errors because it's getting duplicate definitions of all the XHTML elements. Am I at least on the right track? Any suggestions? EDIT: I removed this section from my custom DTD, because it turned out that it was actually self-referencing, and the code I got the template from was really for combining two DTDs into one, not appending specific items to one: <!ENTITY % XHTML1-formvalidation1 PUBLIC "-//W3C//DTD XHTML 1.1 +FormValidation 1.0//EN" "http://new.dandoes.net/DTD/FormValidation1.dtd" > %XHTML1-formvalidation1; I also removed this, because it wasn't validating, and didn't seem to be doing anything: <!ENTITY % Inlspecial.extra "%div.qname; " > Additionally, I decided that since I'm only adding a handful of additional items, the separate files model recommended by W3 doesn't really seem that helpful, so I've put everything into the dtd file, the content of which is now this: <!ATTLIST div onvalidate CDATA #IMPLIED> <!ENTITY % xhtml11.dtd PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" > %xhtml11.dtd; So now, I'm not getting any DTD-related validation errors, but the onvalidate attribute still is not valid. Update: I've ditched the DTD and added a schema: http://schema.dandoes.net/FormValidation/1.0.xsd Using v:onvalidate appears to validate in Visual Studio, but the W3C service still doesn't like it. Here's a page where I'm using it so you can look at the source: http://new.dandoes.net/auth And here's the link to the w3c validation result: http://validator.w3.org/check?uri=http://new.dandoes.net/auth&charset=(detect+automatically)&doctype=Inline&group=0 Is this about as close as I'll be able to get with this, or am I still doing something wrong?

    Read the article

  • in asp.net mvc is it possible to register routes somewhere other than application.Start()

    - by joe q.
    Hi, is it possible to create and register routes after Application.Start() is called? let's say have a controller, PersonController. With default routing, URLs could look something like www.site.com/Person/Edit/4, with 'Person' matching the controller. now imagine I have several users, some may prefer we use the term 'Friends'. I would like to use the same controller, and have /Friends/Edit/4 map to the same controller/action/id. Maybe someone else prefers /Comrades/Edit/4. with the naming preferences stored in a database, is there a way that I can dynamically create these routes at some point mid-application, after the user has logged in? thanks!

    Read the article

  • "Hiding" things in GIT

    - by bobobobo
    Git noob here. I know this is against the principal of "distributed source control" but I want to "password protect" certain development branches in my GIT repository. That is, I don't want that branch to be available via git branch -r, except to a certain group of developers who need access to that branch, via some sort of password. Possible?

    Read the article

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